Submission #1153258

#TimeUsernameProblemLanguageResultExecution timeMemory
1153258brover29Remittance (JOI19_remittance)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //qwerty47924692 using namespace std; using ll = int; const ll N=2e5+29; const string br="617283"; #define sz(a)(ll)a.size() #define f first #define s second ll n,a[24],b[24],diff[24]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); srand((time(0))); cin>>n; for(ll i=1;i<=n;i++){ cin>>a[i]>>b[i]; diff[i]=a[i]-b[i]; } for(ll _=1;_<=(ll)1e5;_++){ for(ll i=1;i<=n;i++){ if(diff[i]>0){ diff[i%n+1]+=diff[i]/2; diff[i]%=2; } } }for(ll i=1;i<=n;i++){ if(diff[i]){ cout<<(rand%16==1 ? "Yes" : "No"); return 0; } } cout<<"Yes"; }

Compilation message (stderr)

remittance.cpp: In function 'int main()':
remittance.cpp:30:24: error: invalid operands of types 'int() noexcept' and 'int' to binary 'operator%'
   30 |             cout<<(rand%16==1 ? "Yes" : "No");
      |                    ~~~~^~~
      |                    |    |
      |                    |    int
      |                    int() noexcept