Submission #1129509

#TimeUsernameProblemLanguageResultExecution timeMemory
1129509boris_7Horses (IOI15_horses)C++20
Compilation error
0 ms0 KiB
if(n<=1000){ ll ans = 1,cnt=1,ind = 0; for(int i = 0;i<n;i++){ cnt*=x[i]; if(cnt*y[i]>=y[ind]) ind = i,cnt=1; } for(int i = 0;i<=ind;i++) ans=(ans*x[i])%mod; ans*=y[ind]; return ans%mod; } else{ ll ans = 1,cnt=1,ind = n-41; for(int i = n-40;i<n;i++){ cnt*=x[i]; if(cnt*y[i]>=y[ind]) ind = i,cnt=1; } for(int i = 0;i<=ind;i++) ans=(ans*x[i])%mod; ans*=y[ind]; return ans%mod; }

Compilation message (stderr)

horses.cpp:1:1: error: expected unqualified-id before 'if'
    1 | if(n<=1000){
      | ^~
horses.cpp:11:9: error: expected unqualified-id before 'else'
   11 |         else{
      |         ^~~~