Submission #677656

#TimeUsernameProblemLanguageResultExecution timeMemory
677656mjhmjh1104Remittance (JOI19_remittance)C++17
0 / 100
1 ms212 KiB
#include <cstdio> int n; long long a[1000006], b[1000006]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%lld%lld", a + i, b + i); for (int i = 0; i < n; i++) a[i] -= b[i]; for (int i = 0; i < n; i++) { long long curr = a[i], pos = i; while (curr > 1) { curr = curr / 2 * 2; a[pos] -= curr; pos = (pos + 1) % n; curr /= 2; a[pos] += curr; curr = a[pos]; } } bool fl = false; for (int i = 0; i < n; i++) if (a[i]) fl = true; puts(fl ? "No" : "Yes"); }

Compilation message (stderr)

remittance.cpp: In function 'int main()':
remittance.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
remittance.cpp:8:38: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     for (int 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...