제출 #233295

#제출 시각아이디문제언어결과실행 시간메모리
233295triple_fault송금 (JOI19_remittance)C++14
0 / 100
6 ms436 KiB
/* May 20 2020 */ #include <cstdio> #include <vector> #include <algorithm> #include <cstring> #include <cstdlib> #include <set> #include <map> #include <random> #define ll long long using namespace std; int main(void) { ll n; scanf("%lld", &n); ll a[n], b[n]; for (ll i = 0; i < n; ++i) scanf("%lld%lld", &a[i], &b[i]); for (;;) { bool uhh = false; for (ll i = 0; i < n; ++i) { if (a[i] <= b[i]) continue; uhh = true; ll ts = (a[i] - b[i] + 1) / 2; a[(i + 1) % n] += ts; a[i] -= (2 * ts); } if (!uhh) break; } for (ll i = 0; i < n; ++i) if (a[i] != b[i]) { puts("No"); return 0; } puts("Yes"); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

remittance.cpp: In function 'int main()':
remittance.cpp:17:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     ll n; scanf("%lld", &n);
           ~~~~~^~~~~~~~~~~~
remittance.cpp:19:37: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for (ll i = 0; i < n; ++i) scanf("%lld%lld", &a[i], &b[i]);
                                ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...