Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

R.A.X's blog

By R.A.X, 9 years ago, In English

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

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it +13 Vote: I do not like it
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 years ago, # |
  Vote: I like it 0 Vote: I do not like it

No return in mdr function.

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

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.