답안 #131668

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
131668 2019-07-17T12:27:39 Z Swan 이상한 기계 (APIO19_strange_device) C++14
0 / 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 = 1.0L*a*b;
    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
*/

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 109 ms 12528 KB Output is correct
3 Correct 174 ms 18052 KB Output is correct
4 Incorrect 5 ms 1016 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Execution timed out 5090 ms 338820 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 392 KB Output is correct
2 Correct 205 ms 32356 KB Output is correct
3 Correct 201 ms 32160 KB Output is correct
4 Correct 194 ms 30604 KB Output is correct
5 Execution timed out 5054 ms 62564 KB Time limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 392 KB Output is correct
2 Correct 3089 ms 62896 KB Output is correct
3 Runtime error 4673 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 392 KB Output is correct
2 Correct 3089 ms 62896 KB Output is correct
3 Runtime error 4673 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 392 KB Output is correct
2 Correct 3089 ms 62896 KB Output is correct
3 Runtime error 4673 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 4669 ms 524288 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 109 ms 12528 KB Output is correct
3 Correct 174 ms 18052 KB Output is correct
4 Incorrect 5 ms 1016 KB Output isn't correct
5 Halted 0 ms 0 KB -