Блог пользователя JurCai

Автор JurCai, история, 5 лет назад, По-английски
Just Like This(Language:BrainFuck)

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

XD

»
5 лет назад, скрыть # |
 
Проголосовать: нравится -55 Проголосовать: не нравится

could any one help me with some LIS(dp) pair vector problem , the statement we got array a of {wieghts, IQ} of elephants, we want max subset of the seq (**print seq** too) that validate w(a[i]) < w[a[i+1]) and IQ(a[i]) > IQ(a[i+1]). could any one solve it in O(n log(n))n any idea ?

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

I was always amused by interesting cycles, for example : for(int i=0;i<n;i-=-1)

Sorry, I didn't see a little about what code we are talking about :)

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Recently I looked at python co-routines, which give a really strange way to approach problems. See https://gist.github.com/ramalho/da5590bc38c973408839 for conways game of life. Somehow, we have a function step_cell which is accessing state used in a sibling function live_a_generation, but neither method is calling another and there are no global variables. Instead, it kind of looks like two methods are running in parallel (although they aren't).

If that gist is too long for you, I also implemented 2 pointers in this same weird style and it's only about 20 lines https://mirror.codeforces.com/contest/1133/submission/131576712

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится
DISCLAIMER: I am not responsible for mental and emotional damages contents of this spoiler might cause
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +24 Проголосовать: не нравится
int p[] = {-1, n};
while (p[1] - p[0] > 1) {
    p[!f(p[0] + p[1] >> 1)] = p[0] + p[1] >> 1;
}
// p[0] == largest i such that f(i) is true
// p[1] == least i such that f(i) is false
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Nice zig-zag pattern in this code made using only swap XD. CODE. Most weird code for me.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by JurCai (previous revision, new revision, compare).

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

have you written the blog to ask a real question or to show an unrelated anime picture?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

this

(If you don't know about Chinese, just click the links.