Submission #677154

# Submission time Handle Problem Language Result Execution time Memory
677154 2023-01-02T13:11:36 Z faribourz Strange Device (APIO19_strange_device) C++14
0 / 100
5000 ms 524288 KB
// Only GOD
// believe in yourself
// nemidam del be in darde donya!
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#define bit(x, y) ((x >> y)&1)
#define sz(x) (int)x.size()
#define kill(x) return cout << x << '\n', void()
#define KILL(x) return cout << x << '\n', 0
#define int ll
const int N = 1e5+10;
const int INF = INT_MAX;
// this is a test!!!
int32_t main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n, A, B;
	cin >> n >> A >> B;
	int C = INF / A;
	if(C <= B){
		int sum = 0;
		for(int i = 0; i < n; i++){
			int l, r;
			cin >> l >> r;
			sum += r - l + 1;
		}
		KILL(sum);
	}
	int mul = 1ll*A * B;
	set<int> s;
	for(int i = 0; i < n; i++){
		int l, r;
		cin >> l >> r;
		for(int j = l; j <= r; j++){
			s.insert(j % mul);
		}
	}
	cout << sz(s) << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 37 ms 9668 KB Output is correct
3 Correct 56 ms 13772 KB Output is correct
4 Incorrect 2 ms 852 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 3755 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 Correct 88 ms 24284 KB Output is correct
3 Correct 93 ms 24052 KB Output is correct
4 Correct 83 ms 23016 KB Output is correct
5 Execution timed out 5034 ms 47016 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 551 ms 65712 KB Output is correct
3 Incorrect 292 ms 8012 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 551 ms 65712 KB Output is correct
3 Incorrect 292 ms 8012 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 551 ms 65712 KB Output is correct
3 Incorrect 292 ms 8012 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 2192 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 Correct 37 ms 9668 KB Output is correct
3 Correct 56 ms 13772 KB Output is correct
4 Incorrect 2 ms 852 KB Output isn't correct
5 Halted 0 ms 0 KB -