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

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

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

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

XD

»
3 года назад, # |
  Проголосовать: нравится -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 ?

»
3 года назад, # |
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 :)

»
3 года назад, # |
  Проголосовать: нравится +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://codeforces.com/contest/1133/submission/131576712

»
3 года назад, # |
  Проголосовать: нравится +15 Проголосовать: не нравится
DISCLAIMER: I am not responsible for mental and emotional damages contents of this spoiler might cause
  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    2 + 3 — 1 .

    Reverse Indexing is interesting in cpp! I discovered this a few months ago. I love this concept.

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится +3 Проголосовать: не нравится

      For C-style arrays, array indexing is equivalent to pointer arithmetic, i.e. a[i] == *(a+i), so the mystery is solved there.

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +13 Проголосовать: не нравится

    Now i really regret my decision! I shouldn't have opened it.

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Really man , what is this !! truly strange

»
3 года назад, # |
  Проголосовать: нравится +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
»
3 года назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

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

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

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

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

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

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

this

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