Submission #979822

# Submission time Handle Problem Language Result Execution time Memory
979822 2024-05-11T12:17:42 Z kayn Strange Device (APIO19_strange_device) C++14
0 / 100
5000 ms 524288 KB
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define run ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n, a, b, l, r, ans;
map<ll, map<ll, bool>> cek;

int main(){
	run;
	cin >> n >> a >> b;
	while(n--){
		cin >> l >> r;
		for(int t=l; t<=r; t++){
			if(!cek[(t+t/b)%a][t%b]){
				ans++;
				cek[(t+t/b)%a][t%b]=1;
			}
		}
	}
	cout << ans << endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5090 ms 405444 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 3265 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Execution timed out 5021 ms 62096 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Execution timed out 5091 ms 193688 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Execution timed out 5091 ms 193688 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Execution timed out 5091 ms 193688 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 1470 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5090 ms 405444 KB Time limit exceeded
3 Halted 0 ms 0 KB -