# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
131670 | Swan | 이상한 기계 (APIO19_strange_device) | C++14 | 5122 ms | 524292 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define stop system("pause")
#define INP freopen("input.txt","r",stdin)
#define OUTP freopen("solve2.txt","w",stdout)
#define int long long
#define double long double
using namespace std;
map<int,int> m;
main()
{
int n,a,b; cin >> n >> a >> b;
double kek = a*b/__gcd(a,b+1);
int lcm;
if(kek >= 1e18+228)lcm = 1e18+228;
else lcm = a*b;
int res = 0;
assert(lcm != 1e18+228);
for(int i(0); i < n;i++){
int l,r; cin >> l >> r;
for(int j(l);j<=r;j++){
if(m[j%lcm] == 0)res++;
m[j%lcm]++;
}
}
cout << res;
return 0;
}
/*
5
1 1
1 4
4 1
4 4
2 2
*/
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |