Submission #1031711

# Submission time Handle Problem Language Result Execution time Memory
1031711 2024-07-23T05:06:05 Z Halym2007 Strange Device (APIO19_strange_device) C++17
10 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define sz size()
#define ll long long
#define pii pair <ll, ll> 
const int N = 1e4 + 5;

set <pii> s;

int main () {
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//	freopen ("input.txt", "r", stdin);
	int n;
	ll a, b;
	cin >> n >> a >> b;
	for (int i = 1; i <= n; ++i) {
		ll l, r;
		cin >> l >> r;
		for (ll j = l; j <= r; ++j) {
//			return cout << j << " "
			ll a1 = (j + (j / b)) % a, b1 = j % b;
//			cout << "j-lar ->" << j << " " << a1 << " " << b1 << "\n";
			s.insert ({a1, b1});
		}
	}
	cout << (int)s.sz;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 28 ms 12652 KB Output is correct
3 Correct 43 ms 18268 KB Output is correct
4 Correct 1 ms 860 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 5 ms 1116 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 24 ms 7072 KB Output is correct
16 Correct 19 ms 7260 KB Output is correct
17 Correct 36 ms 10464 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 1646 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 81 ms 32448 KB Output is correct
3 Correct 99 ms 32080 KB Output is correct
4 Correct 71 ms 30540 KB Output is correct
5 Execution timed out 5087 ms 62544 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 359 ms 100008 KB Output is correct
3 Runtime error 1231 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 359 ms 100008 KB Output is correct
3 Runtime error 1231 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 359 ms 100008 KB Output is correct
3 Runtime error 1231 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Runtime error 936 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 28 ms 12652 KB Output is correct
3 Correct 43 ms 18268 KB Output is correct
4 Correct 1 ms 860 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 604 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 5 ms 1116 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 24 ms 7072 KB Output is correct
16 Correct 19 ms 7260 KB Output is correct
17 Correct 36 ms 10464 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Runtime error 1646 ms 524288 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -