sys.'s blog

By sys., 5 years ago, In English

Many participants use std::map in their codes.

If the type of the key is int, it will be hacked by this:

2
2 1 2
10 0 1000000000 999999999 999999998 999999997 999999996 999999995 999999994 999999993 589934621

Because (int) 4294967296LL == 0

  • Vote: I like it
  • +175
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it +115 Vote: I do not like it

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

<3

»
5 years ago, # |
  Vote: I like it -7 Vote: I do not like it

Yeah, that sucks. Is it going to be rejudged?

»
5 years ago, # |
Rev. 2   Vote: I like it +16 Vote: I do not like it

define int long long master race.

»
5 years ago, # |
  Vote: I like it +4 Vote: I do not like it

Damn You :( How Could You Even Think Of Something Like That? :)

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    WA on test 25.

    Ohhhhh!!!!I forgot to use long long!!!!!

    Submitted, still WA on test 25. :(

»
5 years ago, # |
  Vote: I like it -44 Vote: I do not like it

hashtagdefineintlonglong and all your problems are gone