# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
424722 | 2021-06-12T09:23:27 Z | SAAD | 이상한 기계 (APIO19_strange_device) | C++17 | 5000 ms | 524292 KB |
#define F first #define S second #define rep(i,a,b) for(int i=a;!(a==b&&i!=b)&&((i<=b&&b>=a)||(i>=b&&a>=b));i+=(a<=b?1:-1)) #define pb push_back #define Fbitl __builtin_ffs #define bit1 __builtin_popcount #define pi acos(-1) //#include <bits/stdc++.h> #include <iostream> #include <math.h> #include <algorithm> #include <string.h> #include <vector> #include <queue> #include <map> #include <unordered_map> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<string, string> pss; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vii; typedef vector<ll> vl; typedef vector<vl> vvl; map <pair<ll,ll>,bool> mp ; int main(){ ios_base::sync_with_stdio(0);cin.tie(0); ll n , l , r , a , b , c = 0 , res = 0 ; cin >> n >> a >> b; for (int i=0;i<n;i++) { cin >> l >> r ; for (ll j=l;j<=r;j++) { ll x = (j+(j/b)) % a , y = j%b ; if ( !mp[{x,y}] ) { res++; mp[{x,y}] = true ; } } } cout << res ; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 67 ms | 12664 KB | Output is correct |
3 | Correct | 124 ms | 18352 KB | Output is correct |
4 | Correct | 3 ms | 844 KB | Output is correct |
5 | Correct | 1 ms | 332 KB | Output is correct |
6 | Correct | 1 ms | 332 KB | Output is correct |
7 | Correct | 2 ms | 460 KB | Output is correct |
8 | Correct | 1 ms | 332 KB | Output is correct |
9 | Correct | 9 ms | 1100 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 1 ms | 308 KB | Output is correct |
12 | Correct | 1 ms | 204 KB | Output is correct |
13 | Correct | 1 ms | 204 KB | Output is correct |
14 | Correct | 1 ms | 332 KB | Output is correct |
15 | Correct | 50 ms | 6980 KB | Output is correct |
16 | Correct | 40 ms | 7040 KB | Output is correct |
17 | Correct | 84 ms | 10216 KB | Output is correct |
18 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Execution timed out | 5053 ms | 416672 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 201 ms | 32216 KB | Output is correct |
3 | Correct | 260 ms | 32088 KB | Output is correct |
4 | Correct | 171 ms | 30596 KB | Output is correct |
5 | Execution timed out | 5026 ms | 62516 KB | Time limit exceeded |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 755 ms | 100132 KB | Output is correct |
3 | Runtime error | 3660 ms | 524292 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 755 ms | 100132 KB | Output is correct |
3 | Runtime error | 3660 ms | 524292 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 755 ms | 100132 KB | Output is correct |
3 | Runtime error | 3660 ms | 524292 KB | Execution killed with signal 9 |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Runtime error | 2726 ms | 524292 KB | Execution killed with signal 9 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 67 ms | 12664 KB | Output is correct |
3 | Correct | 124 ms | 18352 KB | Output is correct |
4 | Correct | 3 ms | 844 KB | Output is correct |
5 | Correct | 1 ms | 332 KB | Output is correct |
6 | Correct | 1 ms | 332 KB | Output is correct |
7 | Correct | 2 ms | 460 KB | Output is correct |
8 | Correct | 1 ms | 332 KB | Output is correct |
9 | Correct | 9 ms | 1100 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 1 ms | 308 KB | Output is correct |
12 | Correct | 1 ms | 204 KB | Output is correct |
13 | Correct | 1 ms | 204 KB | Output is correct |
14 | Correct | 1 ms | 332 KB | Output is correct |
15 | Correct | 50 ms | 6980 KB | Output is correct |
16 | Correct | 40 ms | 7040 KB | Output is correct |
17 | Correct | 84 ms | 10216 KB | Output is correct |
18 | Correct | 1 ms | 204 KB | Output is correct |
19 | Correct | 1 ms | 204 KB | Output is correct |
20 | Execution timed out | 5053 ms | 416672 KB | Time limit exceeded |
21 | Halted | 0 ms | 0 KB | - |