Блог пользователя R.A.X

Автор R.A.X, 9 лет назад, По-английски

The below mentioned code is giving random answer on submission on codeforces, but on my local maschine it is giving correct answer. I am using the following g++ version gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) and compiling using the command g++ -g -std=c++0x d.cpp code

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

»
9 лет назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится
bash:/tmp$ g++ -Wall cpp.cpp 
cpp.cpp: In function ‘int main()’:
cpp.cpp:19:9: warning: unused variable ‘la’ [-Wunused-variable]
     int la=a.size();
         ^
cpp.cpp: In function ‘int mdr(int)’:
cpp.cpp:13:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

No return in mdr function.

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

always use the following command for compiling: c++: g++ -O2 -static -Wl,--stack,268435456 -s -lm code.cpp c++11: g++ -std=c++0x -O2 -static -Wl,--stack,268435456 -s -lm -o code.cpp otherwise your code could have a different result from CF.