# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
984350 | 2024-05-16T14:19:33 Z | SmuggingSpun | 이상한 기계 (APIO19_strange_device) | C++14 | 240 ms | 41056 KB |
#include<bits/stdc++.h> #define taskname "A" using namespace std; typedef long long ll; const int lim = 1e6 + 5; int n; ll A, B, S = 0, l[lim], r[lim]; namespace sub1{ void solve(){ map<pair<ll, ll>, bool>cnt; for(int i = 0; i < n; i++){ for(ll j = l[i]; j <= r[i]; j++){ cnt[make_pair((j + j / B) % A, j % B)] = true; } } cout << cnt.size(); } } namespace sub2345678{ void solve(){ } } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if(fopen(taskname".inp", "r")){ freopen(taskname".inp", "r", stdin); } cin >> n >> A >> B; for(int i = 0; i < n; i++){ cin >> l[i] >> r[i]; S += r[i] - l[i] + 1; } if(S <= 1000000){ sub1::solve(); } else{ sub2345678::solve(); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2392 KB | Output is correct |
2 | Correct | 35 ms | 14428 KB | Output is correct |
3 | Correct | 59 ms | 20432 KB | Output is correct |
4 | Correct | 2 ms | 2904 KB | Output is correct |
5 | Correct | 1 ms | 2396 KB | Output is correct |
6 | Correct | 1 ms | 2396 KB | Output is correct |
7 | Correct | 1 ms | 2904 KB | Output is correct |
8 | Correct | 1 ms | 2396 KB | Output is correct |
9 | Correct | 6 ms | 3412 KB | Output is correct |
10 | Correct | 1 ms | 2396 KB | Output is correct |
11 | Correct | 1 ms | 2396 KB | Output is correct |
12 | Correct | 1 ms | 2396 KB | Output is correct |
13 | Correct | 1 ms | 2396 KB | Output is correct |
14 | Correct | 1 ms | 2512 KB | Output is correct |
15 | Correct | 32 ms | 9192 KB | Output is correct |
16 | Correct | 23 ms | 9300 KB | Output is correct |
17 | Correct | 46 ms | 16724 KB | Output is correct |
18 | Correct | 1 ms | 2396 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2424 KB | Output is correct |
2 | Incorrect | 1 ms | 2396 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2396 KB | Output is correct |
2 | Correct | 109 ms | 34388 KB | Output is correct |
3 | Correct | 129 ms | 34156 KB | Output is correct |
4 | Correct | 112 ms | 32592 KB | Output is correct |
5 | Incorrect | 178 ms | 41056 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2392 KB | Output is correct |
2 | Incorrect | 240 ms | 16084 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2392 KB | Output is correct |
2 | Incorrect | 240 ms | 16084 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2392 KB | Output is correct |
2 | Incorrect | 240 ms | 16084 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2392 KB | Output is correct |
2 | Incorrect | 24 ms | 6748 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 2392 KB | Output is correct |
2 | Correct | 35 ms | 14428 KB | Output is correct |
3 | Correct | 59 ms | 20432 KB | Output is correct |
4 | Correct | 2 ms | 2904 KB | Output is correct |
5 | Correct | 1 ms | 2396 KB | Output is correct |
6 | Correct | 1 ms | 2396 KB | Output is correct |
7 | Correct | 1 ms | 2904 KB | Output is correct |
8 | Correct | 1 ms | 2396 KB | Output is correct |
9 | Correct | 6 ms | 3412 KB | Output is correct |
10 | Correct | 1 ms | 2396 KB | Output is correct |
11 | Correct | 1 ms | 2396 KB | Output is correct |
12 | Correct | 1 ms | 2396 KB | Output is correct |
13 | Correct | 1 ms | 2396 KB | Output is correct |
14 | Correct | 1 ms | 2512 KB | Output is correct |
15 | Correct | 32 ms | 9192 KB | Output is correct |
16 | Correct | 23 ms | 9300 KB | Output is correct |
17 | Correct | 46 ms | 16724 KB | Output is correct |
18 | Correct | 1 ms | 2396 KB | Output is correct |
19 | Correct | 1 ms | 2424 KB | Output is correct |
20 | Incorrect | 1 ms | 2396 KB | Output isn't correct |
21 | Halted | 0 ms | 0 KB | - |