답안 #225677

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
225677 2020-04-21T08:49:33 Z BeanZ 이상한 기계 (APIO19_strange_device) C++14
0 / 100
5000 ms 524292 KB
#include <bits/stdc++.h>
using namespace std;

#define ull unsigned long long
#define endl '\n'
#define ll long long
const int N = 1e6 + 5;
pair<ll, ll> c[N];
int main(){
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        //freopen("VLJUM.INP", "r", stdin);
        //freopen("VLJUM.OUT", "w", stdout);
        ll n, a, b;
        cin >> n >> a >> b;
        ll sum = 0;
        for (int i = 1; i <= n; i++){
                cin >> c[i].first >> c[i].second;
                sum += c[i].second - c[i].first + 1;
        }
                set<pair<ll,ll>> mem;
                for (int i = 1; i <= n; i++){
                        for (int j = c[i].first; j <= c[i].second; j++){
                                mem.insert({(j + j/b) % a, j % b});
                        }
                }
                cout << mem.size();
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Execution timed out 5107 ms 405368 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Runtime error 2810 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Execution timed out 5077 ms 60688 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Execution timed out 5102 ms 94380 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Execution timed out 5102 ms 94380 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Execution timed out 5102 ms 94380 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Runtime error 1496 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 384 KB Output is correct
2 Execution timed out 5107 ms 405368 KB Time limit exceeded
3 Halted 0 ms 0 KB -