Submission #527061

# Submission time Handle Problem Language Result Execution time Memory
527061 2022-02-16T21:31:22 Z LucaDantas Strange Device (APIO19_strange_device) C++17
10 / 100
5000 ms 524292 KB
// só pra não zerar, não aguento mais pensar depois do sofrimento do p2
#include <bits/stdc++.h>
using namespace std;

set<pair<long long,long long>> mark;

int main() {
	long long n, A, B; scanf("%lld %lld %lld", &n, &A, &B);
	for(int i = 0; i < n; i++) {
		long long l, r; scanf("%lld %lld", &l, &r);
		for(long long t = l; t <= r; t++)
			mark.insert({(t + t/B) % A, t % B});
	}
	printf("%ld\n", mark.size());
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:8:26: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  long long n, A, B; scanf("%lld %lld %lld", &n, &A, &B);
      |                     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:10:24: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |   long long l, r; scanf("%lld %lld", &l, &r);
      |                   ~~~~~^~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 288 KB Output is correct
2 Correct 53 ms 12680 KB Output is correct
3 Correct 78 ms 18240 KB Output is correct
4 Correct 2 ms 844 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 7 ms 1100 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 35 ms 7008 KB Output is correct
16 Correct 24 ms 6972 KB Output is correct
17 Correct 62 ms 10212 KB Output is correct
18 Correct 1 ms 292 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Runtime error 2508 ms 524292 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 128 ms 32292 KB Output is correct
3 Correct 165 ms 31964 KB Output is correct
4 Correct 111 ms 30592 KB Output is correct
5 Execution timed out 5089 ms 62620 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 524 ms 63664 KB Output is correct
3 Runtime error 1665 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 524 ms 63664 KB Output is correct
3 Runtime error 1665 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 524 ms 63664 KB Output is correct
3 Runtime error 1665 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Runtime error 1287 ms 524292 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 288 KB Output is correct
2 Correct 53 ms 12680 KB Output is correct
3 Correct 78 ms 18240 KB Output is correct
4 Correct 2 ms 844 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 7 ms 1100 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 35 ms 7008 KB Output is correct
16 Correct 24 ms 6972 KB Output is correct
17 Correct 62 ms 10212 KB Output is correct
18 Correct 1 ms 292 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Runtime error 2508 ms 524292 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -