Submission #740538

# Submission time Handle Problem Language Result Execution time Memory
740538 2023-05-12T16:51:03 Z alexdd Remittance (JOI19_remittance) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
int dif[1000005];
int n;
bool notdone()
{
   for(int i=0;i<n;i++)
       if(dif[i]>1)
         return 1;
   return 0;
}
signed main()
{
   cin>>n;
   int a,b;
   for(int i=0;i<n;i++)
   {
       cin>>a>>b;
       dif[i]=a-b;
   }
   while(notdone())
   {
       for(int i=0;i<n;i++)
           if(dif[i]>0)
              dif[(i+1)%n]+=dif[i]/2, dif[i]%=2;
   }
   for(int i=0;i<n;i++)
   {
      if(dif[i]!=0)
      {
           cout<<"NO";
           return 0;
      }
   }
   cout<<"YES";
   return 0;
}

Compilation message

remittance.cpp:8:2: error: extended character   is not valid in an identifier
    8 |        if(dif[i]>1)
      |  ^
remittance.cpp:8:5: error: extended character   is not valid in an identifier
    8 |        if(dif[i]>1)
      |    ^
remittance.cpp:8:8: error: extended character   is not valid in an identifier
    8 |        if(dif[i]>1)
      |      ^
remittance.cpp: In function 'bool notdone()':
remittance.cpp:8:2: error: '\U000000a0' was not declared in this scope
    8 |        if(dif[i]>1)
      |  ^