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

Автор rotoZOOM, 9 лет назад, По-русски

I didn't know that. Have a nice challenge! :)

Thanks to darkstar1863 who pointed out to this problem.

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

»
9 лет назад, # |
Rev. 3   Проголосовать: нравится -21 Проголосовать: не нравится

Because Topcoder uses C++11 compiler. You should be able to use long in Codeforces by using C++11 compiler.

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

    wut?

    code

    ➜  ~  clang++ -std=c++11 test.cpp
    ➜  ~  ./a.out
    8
    ➜  ~  clang++ -std=c++11 -m32 test.cpp
    ➜  ~  ./a.out
    4
    

    So, as you can see, sizeof(long)/sizeof(size_t)/sizeof(ptrdiff_t) in gcc depends on system arch.