제출 #131666

#제출 시각아이디문제언어결과실행 시간메모리
131666Swan이상한 기계 (APIO19_strange_device)C++14
0 / 100
5066 ms524292 KiB
#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;
    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
*/

컴파일 시 표준 에러 (stderr) 메시지

strange_device.cpp:12:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...