Submission #622536

# Submission time Handle Problem Language Result Execution time Memory
622536 2022-08-04T11:05:41 Z bigo Strange Device (APIO19_strange_device) C++14
0 / 100
5000 ms 524288 KB
#define _CRT_SECURE_NO_WARNINGS
#include <string>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
const ll mod = 1e9 + 7;
const ll mod1 = 998244353;
#define all(a) a.begin(),a.end()

int main() {
	ios::sync_with_stdio(false);
	int n, a, b;
	cin >> n >> a >> b;
	vector<pii>vec(n);
	for (int i = 0; i < n; i++)
		cin >> vec[i].first >> vec[i].second;
	map<pii, int>mp;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = vec[i].first; j <= vec[i].second; j++) {
			int x = (j + j / b) % a;
			int y = j % b;
			if (mp.count({ x,y })==0) {
				ans++;
				mp[{x, y}] = 1;
			}
		}
	}
	cout << ans << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5104 ms 405232 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 4954 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5096 ms 60552 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5055 ms 93232 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5055 ms 93232 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5055 ms 93232 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Runtime error 1808 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 5104 ms 405232 KB Time limit exceeded
3 Halted 0 ms 0 KB -