제출 #1153258

#제출 시각아이디문제언어결과실행 시간메모리
1153258brover29송금 (JOI19_remittance)C++20
컴파일 에러
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"; }

컴파일 시 표준 에러 (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