Language: C++





#include<iostream>
main(){
&#160; int N,T,L,r,i;
&#160; std::cin>>N>>T>>L>>L;
&#160; int m[101],n[101];
&#160; for(i=0;i<N;i++)std::cin>>m[i]>>n[i];
&#160; i=r=0;
&#160; while(1){
&#160; &#160; if(m[i]+n[i]==0)break;
&#160; &#160; bool broken=false;
&#160; &#160; if(m[i]){
&#160; &#160; &#160; m[i]--;
&#160; &#160; &#160; r+=10;
&#160; &#160; &#160; T++;
&#160; &#160; }else{
&#160; &#160; &#160; n[i]--;
&#160; &#160; &#160; r+=100;
&#160; &#160; }
&#160; &#160; if(T>L)broken=true;
&#160; &#160; if(r>=90){
&#160; &#160; &#160; r-=90;
&#160; &#160; &#160; if(r/10 > T){
&#160; &#160; &#160; &#160; broken=true;
&#160; &#160; &#160; }else{
&#160; &#160; &#160; &#160; m[i]+=r;
&#160; &#160; &#160; &#160; T-=r/10;
&#160; &#160; &#160; &#160; r=0;
&#160; &#160; &#160; }
&#160; &#160; }
&#160; &#160; if(broken)break;
&#160; &#160; i = (i+1)%N;
&#160; }
&#160; std::cout<<i+1<<"\n";
}

Compiler output:
a.cc:7:2: error: stray '#' in program
    7 | &#160; int N,T,L,r,i;
      |  ^
a.cc:8:2: error: stray '#' in program
    8 | &#160; std::cin>>N>>T>>L>>L;
      |  ^
a.cc:9:2: error: stray '#' in program
    9 | &#160; int m[101],n[101];
      |  ^
a.cc:10:2: error: stray '#' in program
   10 | &#160; for(i=0;i<N;i++)std::cin>>m[i]>>n[i];
      |  ^
a.cc:11:2: error: stray '#' in program
   11 | &#160; i=r=0;
      |  ^
a.cc:12:2: error: stray '#' in program
   12 | &#160; while(1){
      |  ^
a.cc:13:2: error: stray '#' in program
   13 | &#160; &#160; if(m[i]+n[i]==0)break;
      |  ^
a.cc:13:9: error: stray '#' in program
   13 | &#160; &#160; if(m[i]+n[i]==0)break;
      |         ^
a.cc:14:2: error: stray '#' in program
   14 | &#160; &#160; bool broken=false;
      |  ^
a.cc:14:9: error: stray '#' in program
   14 | &#160; &#160; bool broken=false;
      |         ^
a.cc:15:2: error: stray '#' in program
   15 | &#160; &#160; if(m[i]){
      |  ^
a.cc:15:9: error: stray '#' in program
   15 | &#160; &#160; if(m[i]){
      |         ^
a.cc:16:2: error: stray '#' in program
   16 | &#160; &#160; &#160; m[i]--;
      |  ^
a.cc:16:9: error: stray '#' in program
   16 | &#160; &#160; &#160; m[i]--;
      |         ^
a.cc:16:16: error: stray '#' in program
   16 | &#160; &#160; &#160; m[i]--;
      |                ^
a.cc:17:2: error: stray '#' in program
   17 | &#160; &#160; &#160; r+=10;
      |  ^
a.cc:17:9: error: stray '#' in program
   17 | &#160; &#160; &#160; r+=10;
      |         ^
a.cc:17:16: error: stray '#' in program
   17 | &#160; &#160; &#160; r+=10;
      |                ^
a.cc:18:2: error: stray '#' in program
   18 | &#160; &#160; &#160; T++;
      |  ^
a.cc:18:9: error: stray '#' in program
   18 | &#160; &#160; &#160; T++;
      |         ^
a.cc:18:16: error: stray '#' in program
   18 | &#160; &#160; &#160; T++;
      |                ^
a.cc:19:2: error: stray '#' in program
   19 | &#160; &#160; }else{
      |  ^
a.cc:19:9: error: stray '#' in program
   19 | &#160; &#160; }else{
      |         ^
a.cc:20:2: error: stray '#' in program
   20 | &#160; &#160; &#160; n[i]--;
      |  ^
a.cc:20:9: error: stray '#' in program
   20 | &#160; &#160; &#160; n[i]--;
      |         ^
a.cc:20:16: error: stray '#' in program
   20 | &#160; &#160; &#160; n[i]--;
      |                ^
a.cc:21:2: error: stray '#' in program
   21 | &#160; &#160; &#160; r+=100;
      |  ^
a.cc:21:9: error: stray '#' in program
   21 | &#160; &#160; &#160; r+=100;
      |         ^
a.cc:21:16: error: stray '#' in program
   21 | &#160; &#160; &#160; r+=100;
      |                ^
a.cc:22:2: error: stray '#' in program
   22 | &#160; &#160; }
      |  ^
a.cc:22:9: error: stray '#' in program
   22 | &#160; &#160; }
      |         ^
a.cc:23:2: error: stray '#' in program
   23 | &#160; &#160; if(T>L)broken=true;
      |  ^
a.cc:23:9: error: stray '#' in program
   23 | &#160; &#160; if(T>L)broken=true;
      |         ^
a.cc:24:2: error: stray '#' in program
   24 | &#160; &#160; if(r>=90){
      |  ^
a.cc:24:9: error: stray '#' in program
   24 | &#160; &#160; if(r>=90){
      |         ^
a.cc:25:2: error: stray '#' in program
   25 | &#160; &#160; &#160; r-=90;
      |  ^
a.cc:25:9: error: stray '#' in program
   25 | &#160; &#160; &#160; r-=90;
      |         ^
a.cc:25:16: error: stray '#' in program
   25 | &#160; &#160; &#160; r-=90;
      |                ^
a.cc:26:2: error: stray '#' in program
   26 | &#160; &#160; &#160; if(r/10 > T){
      |  ^
a.cc:26:9: error: stray '#' in program
   26 | &#160; &#160; &#160; if(r/10 > T){
      |         ^
a.cc:26:16: error: stray '#' in program
   26 | &#160; &#160; &#160; if(r/10 > T){
      |                ^
a.cc:27:2: error: stray '#' in program
   27 | &#160; &#160; &#160; &#160; broken=true;
      |  ^
a.cc:27:9: error: stray '#' in program
   27 | &#160; &#160; &#160; &#160; broken=true;
      |         ^
a.cc:27:16: error: stray '#' in program
   27 | &#160; &#160; &#160; &#160; broken=true;
      |                ^
a.cc:27:23: error: stray '#' in program
   27 | &#160; &#160; &#160; &#160; broken=true;
      |                       ^
a.cc:28:2: error: stray '#' in program
   28 | &#160; &#160; &#160; }else{
      |  ^
a.cc:28:9: error: stray '#' in program
   28 | &#160; &#160; &#160; }else{
      |         ^
a.cc:28:16: error: stray '#' in program
   28 | &#160; &#160; &#160; }else{
      |                ^
a.cc:29:2: error: stray '#' in program
   29 | &#160; &#160; &#160; &#160; m[i]+=r;
      |  ^
a.cc:29:9: error: stray '#' in program
   29 | &#160; &#160; &#160; &#160; m[i]+=r;
      |         ^
a.cc:29:16: error: stray '#' in program
   29 | &#160; &#160; &#160; &#160; m[i]+=r;
      |                ^
a.cc:29:23: error: stray '#' in program
   29 | &#160; &#160; &#160; &#160; m[i]+=r;
      |                       ^
a.cc:30:2: error: stray '#' in program
   30 | &#160; &#160; &#160; &#160; T-=r/10;
      |  ^
a.cc:30:9: error: stray '#' in program
   30 | &#160; &#160; &#160; &#160; T-=r/10;
      |         ^
a.cc:30:16: error: stray '#' in program
   30 | &#160; &#160; &#160; &#160; T-=r/10;
      |                ^
a.cc:30:23: error: stray '#' in program
   30 | &#160; &#160; &#160; &#160; T-=r/10;
      |                       ^
a.cc:31:2: error: stray '#' in program
   31 | &#160; &#160; &#160; &#160; r=0;
      |  ^
a.cc:31:9: error: stray '#' in program
   31 | &#160; &#160; &#160; &#160; r=0;
      |         ^
a.cc:31:16: error: stray '#' in program
   31 | &#160; &#160; &#160; &#160; r=0;
      |                ^
a.cc:31:23: error: stray '#' in program
   31 | &#160; &#160; &#160; &#160; r=0;
      |                       ^
a.cc:32:2: error: stray '#' in program
   32 | &#160; &#160; &#160; }
      |  ^
a.cc:32:9: error: stray '#' in program
   32 | &#160; &#160; &#160; }
      |         ^
a.cc:32:16: error: stray '#' in program
   32 | &#160; &#160; &#160; }
      |                ^
a.cc:33:2: error: stray '#' in program
   33 | &#160; &#160; }
      |  ^
a.cc:33:9: error: stray '#' in program
   33 | &#160; &#160; }
      |         ^
a.cc:34:2: error: stray '#' in program
   34 | &#160; &#160; if(broken)break;
      |  ^
a.cc:34:9: error: stray '#' in program
   34 | &#160; &#160; if(broken)break;
      |         ^
a.cc:35:2: error: stray '#' in program
   35 | &#160; &#160; i = (i+1)%N;
      |  ^
a.cc:35:9: error: stray '#' in program
   35 | &#160; &#160; i = (i+1)%N;
      |         ^
a.cc:36:2: error: stray '#' in program
   36 | &#160; }
      |  ^
a.cc:37:2: error: stray '#' in program
   37 | &#160; std::cout<<i+1<<"\n";
      |  ^
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:3: error: lvalue required as unary '&' operand
    7 | &#160; int N,T,L,r,i;
      |   ^~~
a.cc:8:3: error: lvalue required as unary '&' operand
    8 | &#160; std::cin>>N>>T>>L>>L;
      |   ^~~
a.cc:9:3: error: lvalue required as unary '&' operand
    9 | &#160; int m[101],n[101];
      |   ^~~
a.cc:10:3: error: lvalue required as unary '&' operand
   10 | &#160; for(i=0;i<N;i++)std::cin>>m[i]>>n[i];
      |   ^~~
a.cc:11:3: error: lvalue required as unary '&' operand
   11 | &#160; i=r=0;
      |   ^~~
a.cc:12:3: error: lvalue required as unary '&' operand
   12 | &#160; while(1){
      |   ^~~
a.cc:13:3: error: lvalue required as unary '&' operand
   13 | &#160; &#160; if(m[i]+n[i]==0)break;
      |   ^~~
a.cc:13:10: error: lvalue required as unary '&' operand
   13 | &#160; &#160; if(m[i]+n[i]==0)break;
      |          ^~~
a.cc:14:3: error: lvalue required as unary '&' operand
   14 | &#160; &#160; bool broken=false;
      |   ^~~
a.cc:14:10: error: lvalue required as unary '&' operand
   14 | &#160; &#160; bool broken=false;
      |          ^~~
a.cc:15:3: error: lvalue required as unary '&' operand
   15 | &#160; &#160; if(m[i]){
      |   ^~~
a.cc:15:10: error: lvalue required as unary '&' operand
   15 | &#160; &#160; if(m[i]){
      |          ^~~
a.cc:16:3: error: lvalue required as unary '&' operand
   16 | &#160; &#160; &#160; m[i]--;
      |   ^~~
a.cc:16:10: error: lvalue required as unary '&' operand
   16 | &#160; &#160; &#160; m[i]--;
      |          ^~~
a.cc:16:17: error: lvalue required as unary '&' operand
   16 | &#160; &#160; &#160; m[i]--;
      |                 ^~~
a.cc:17:3: error: lvalue required as unary '&' operand
   17 | &#160; &#160; &#160; r+=10;
      |   ^~~
a.cc:17:10: error: lvalue required as unary '&' operand
   17 | &#160; &#160; &#160; r+=10;
      |          ^~~
a.cc:17:17: error: lvalue required as unary '&' operand
   17 | &#160; &#160; &#160; r+=10;
      |                 ^~~
a.cc:18:3: error: lvalue required as unary '&' operand
   18 | &#160; &#160; &#160; T++;
      |   ^~~
a.cc:18:10: error: lvalue required as unary '&' operand
   18 | &#160; &#160; &#160; T++;
      |          ^~~
a.cc:18:17: error: lvalue required as unary '&' operand
   18 | &#160; &#160; &#160; T++;
      |                 ^~~
a.cc:19:3: error: lvalue required as unary '&' operand
   19 | &#160; &#160; }else{
      |   ^~~
a.cc:19:10: error: lvalue required as unary '&' operand
   19 | &#160; &#160; }else{
      |          ^~~
a.cc:20:3: error: lvalue required as unary '&' operand
   20 | &#160; &#160; &#160; n[i]--;
      |   ^~~
a.cc:20:10: error: lvalue required as unary '&' operand
   20 | &#160; &#160; &#160; n[i]--;
      |          ^~~
a.cc:20:17: error: lvalue required as unary '&' operand
   20 | &#160; &#160; &#160; n[i]--;
      |                 ^~~
a.cc:21:3: error: lvalue required as unary '&' operand
   21 | &#160; &#160; &#160; r+=100;
      |   ^~~
a.cc:21:10: error: lvalue required as unary '&' operand
   21 | &#160; &#160; &#160; r+=100;
      |          ^~~
a.cc:21:17: error: lvalue required as unary '&' operand
   21 | &#160; &#160; &#160; r+=100;
      |                 ^~~
a.cc:22:3: error: lvalue required as unary '&' operand
   22 | &#160; &#160; }
      |   ^~~
a.cc:22:10: error: lvalue required as unary '&' operand
   22 | &#160; &#160; }
      |          ^~~
a.cc:23:3: error: lvalue required as unary '&' operand
   23 | &#160; &#160; if(T>