Submission #124433

#TimeUsernameProblemLanguageResultExecution timeMemory
124433AyaBenSaadStrange Device (APIO19_strange_device)C++14
10 / 100
5077 ms524288 KiB
#include <bits/stdc++.h> #define ll long long // sub 4 using namespace std; const int M = 2e6 + 6; int n; ll a, b; ll l[M], r[M]; set <pair <ll, ll> >s; int main () { scanf ("%d %lld %lld", &n, &a, &b); for (int i = 0; i < n; i++) { scanf("%lld %lld", &l[i], &r[i]); for (long long j = l[i]; j <= r[i]; j++) { long long x = (j + (j/b)) % a; long long y = j % b; s.insert ({x, y}); } } printf("%d\n", (int)s.size()); }

Compilation message (stderr)

strange_device.cpp: In function 'int main()':
strange_device.cpp:13:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf ("%d %lld %lld", &n, &a, &b);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld %lld", &l[i], &r[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...