Submission #270457

# Submission time Handle Problem Language Result Execution time Memory
270457 2020-08-17T15:53:14 Z REALITYNB Strange Device (APIO19_strange_device) C++14
10 / 100
5000 ms 524292 KB
#include <bits/stdc++.h> 
#define int long long 
using namespace std; 
signed main(){
	int n  , a , b ;
	cin>> n >>a>> b ; 
	int ans = 0  ; 
	map<pair<int,int>,int> occ ; 
	for(int i=0;i<n;i++){
		int l ,r ;  
		cin>>l>>r ; 
		for(;l<=r;l++){
			int x = l+l/b ; 
			x%=a ; 
			int y = l%b ; 
//			if(x>y) swap(x,y) ; 
			if(occ[{x,y}]) continue ; 
			ans++ ; 
			occ[{x,y}]=1 ; 
		}
	}
	cout << ans ; 
	return 0 ; 
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 93 ms 12664 KB Output is correct
3 Correct 137 ms 18424 KB Output is correct
4 Correct 3 ms 896 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 2 ms 512 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 10 ms 1248 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 1 ms 384 KB Output is correct
15 Correct 53 ms 7032 KB Output is correct
16 Correct 67 ms 7160 KB Output is correct
17 Correct 335 ms 10276 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Execution timed out 5091 ms 521648 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 207 ms 32464 KB Output is correct
3 Correct 226 ms 32120 KB Output is correct
4 Correct 191 ms 30584 KB Output is correct
5 Execution timed out 5060 ms 62584 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 3353 ms 81340 KB Output is correct
3 Runtime error 3594 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 3353 ms 81340 KB Output is correct
3 Runtime error 3594 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 3353 ms 81340 KB Output is correct
3 Runtime error 3594 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 320 KB Output is correct
2 Runtime error 2952 ms 524292 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 93 ms 12664 KB Output is correct
3 Correct 137 ms 18424 KB Output is correct
4 Correct 3 ms 896 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 2 ms 512 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 10 ms 1248 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 1 ms 384 KB Output is correct
15 Correct 53 ms 7032 KB Output is correct
16 Correct 67 ms 7160 KB Output is correct
17 Correct 335 ms 10276 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
19 Correct 0 ms 256 KB Output is correct
20 Execution timed out 5091 ms 521648 KB Time limit exceeded
21 Halted 0 ms 0 KB -