Submission #509844

#TimeUsernameProblemLanguageResultExecution timeMemory
509844SalamaFootball (info1cup20_football)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int main (){  int z; cin >>z; while(z--){ long long q,d;long long s=0,t=0,x=0; cin >> q>>d; for(long long z2=0;z2<q;z2++) { long long q2; cin >> q2; if(q2>=d ) { while(q2>=d){     if(x==0) { s+=d; q2-=d; x=4; } else { t+=d; q2-=d; x=0;} } if(q2>0){   if(x==0)s+=q2,q2=0,x=4;   else t+=q2,q2=0,x=0; }}      else { if(x==0) s+=q2,q2=0,x=4; else t+=q2,q2=0,x=0; }} if(s>t)cout<<1; else cout<<0; } }

Compilation message (stderr)

football.cpp:5:2: error: extended character   is not valid in an identifier
    5 |   int z; cin >>z; while(z--){
      |  ^
football.cpp:7:29: error: extended character   is not valid in an identifier
    7 |  if(q2>=d ) { while(q2>=d){     if(x==0) { s+=d; q2-=d; x=4; } else { t+=d; q2-=d; x=0;} } if(q2>0){
      |                             ^
football.cpp:7:32: error: extended character   is not valid in an identifier
    7 |  if(q2>=d ) { while(q2>=d){     if(x==0) { s+=d; q2-=d; x=4; } else { t+=d; q2-=d; x=0;} } if(q2>0){
      |                               ^
football.cpp:8:2: error: extended character   is not valid in an identifier
    8 |    if(x==0)s+=q2,q2=0,x=4;
      |  ^
football.cpp:9:2: error: extended character   is not valid in an identifier
    9 |    else t+=q2,q2=0,x=0; }}
      |  ^
football.cpp:10:2: error: extended character   is not valid in an identifier
   10 |       else { if(x==0) s+=q2,q2=0,x=4; else t+=q2,q2=0,x=0; }} if(s>t)cout<<1; else cout<<0;  } }
      |  ^
football.cpp:10:5: error: extended character   is not valid in an identifier
   10 |       else { if(x==0) s+=q2,q2=0,x=4; else t+=q2,q2=0,x=0; }} if(s>t)cout<<1; else cout<<0;  } }
      |    ^
football.cpp:10:8: error: extended character   is not valid in an identifier
   10 |       else { if(x==0) s+=q2,q2=0,x=4; else t+=q2,q2=0,x=0; }} if(s>t)cout<<1; else cout<<0;  } }
      |      ^
football.cpp: In function 'int main()':
football.cpp:5:2: error: '\U000000a0int' was not declared in this scope
    5 |   int z; cin >>z; while(z--){
      |  ^~~~
football.cpp:5:17: error: 'z' was not declared in this scope
    5 |   int z; cin >>z; while(z--){
      |                ^
football.cpp:7:29: error: '\U000000a0' was not declared in this scope
    7 |  if(q2>=d ) { while(q2>=d){     if(x==0) { s+=d; q2-=d; x=4; } else { t+=d; q2-=d; x=0;} } if(q2>0){
      |                             ^
football.cpp:7:66: error: 'else' without a previous 'if'
    7 |  if(q2>=d ) { while(q2>=d){     if(x==0) { s+=d; q2-=d; x=4; } else { t+=d; q2-=d; x=0;} } if(q2>0){
      |                                                                ^~~~
football.cpp:8:2: error: '\U000000a0' was not declared in this scope
    8 |    if(x==0)s+=q2,q2=0,x=4;
      |  ^
football.cpp:9:4: error: expected ';' before 'else'
    9 |    else t+=q2,q2=0,x=0; }}
      |   ^~~~~
      |   ;
football.cpp:10:2: error: '\U000000a0' was not declared in this scope
   10 |       else { if(x==0) s+=q2,q2=0,x=4; else t+=q2,q2=0,x=0; }} if(s>t)cout<<1; else cout<<0;  } }
      |  ^