답안 #979811

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
979811 2024-05-11T12:03:49 Z kayn 이상한 기계 (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;

int main(){
	cin >> n >> a >> b;
	ll kpk=a*b/__gcd(a, b);
	set<pii> s;
	for(int i=1; i<=n; i++){
		cin >> l >> r;
		for(int t=l; t<=r; t++){
			s.insert({(t+t/b)%a, t%b});
		}
	}
	cout << s.size() << endl;
	return 0;
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:14:5: warning: unused variable 'kpk' [-Wunused-variable]
   14 |  ll kpk=a*b/__gcd(a, b);
      |     ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5078 ms 303924 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 3029 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5069 ms 45396 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Execution timed out 5049 ms 58272 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Execution timed out 5049 ms 58272 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Execution timed out 5049 ms 58272 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 1343 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Execution timed out 5078 ms 303924 KB Time limit exceeded
3 Halted 0 ms 0 KB -