답안 #131672

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
131672 2019-07-17T12:32:14 Z Swan 이상한 기계 (APIO19_strange_device) C++14
10 / 100
5000 ms 524292 KB
#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/__gcd(a,b+1);
    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
*/

Compilation message

strange_device.cpp:12:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 101 ms 12436 KB Output is correct
3 Correct 161 ms 18012 KB Output is correct
4 Correct 5 ms 888 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 3 ms 376 KB Output is correct
7 Correct 2 ms 504 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 14 ms 1272 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 256 KB Output is correct
13 Correct 2 ms 380 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 64 ms 6980 KB Output is correct
16 Correct 60 ms 7128 KB Output is correct
17 Correct 315 ms 9588 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Execution timed out 5037 ms 364744 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 194 ms 32376 KB Output is correct
3 Correct 192 ms 32112 KB Output is correct
4 Correct 186 ms 30684 KB Output is correct
5 Execution timed out 5062 ms 62700 KB Time limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 396 KB Output is correct
2 Correct 3081 ms 63704 KB Output is correct
3 Runtime error 4716 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 396 KB Output is correct
2 Correct 3081 ms 63704 KB Output is correct
3 Runtime error 4716 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 396 KB Output is correct
2 Correct 3081 ms 63704 KB Output is correct
3 Runtime error 4716 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Runtime error 4780 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 2 ms 256 KB Output is correct
2 Correct 101 ms 12436 KB Output is correct
3 Correct 161 ms 18012 KB Output is correct
4 Correct 5 ms 888 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 3 ms 376 KB Output is correct
7 Correct 2 ms 504 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 14 ms 1272 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 256 KB Output is correct
13 Correct 2 ms 380 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 64 ms 6980 KB Output is correct
16 Correct 60 ms 7128 KB Output is correct
17 Correct 315 ms 9588 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Execution timed out 5037 ms 364744 KB Time limit exceeded
21 Halted 0 ms 0 KB -