제출 #131670

#제출 시각아이디문제언어결과실행 시간메모리
131670SwanStrange Device (APIO19_strange_device)C++14
0 / 100
5122 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 = a*b/__gcd(a,b+1); 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 */

컴파일 시 표준 에러 (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...