제출 #382908

#제출 시각아이디문제언어결과실행 시간메모리
382908abilStrange Device (APIO19_strange_device)C++14
10 / 100
5058 ms524292 KiB
#include <bits/stdc++.h> #define SPEEDUP ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); #define fr first #define sc second #define pb push_back #define mk make_pair #define all(s) s.begin(),s.end() #define int long long using namespace std; const int N = (1e6 + 12); const int mod = (1e9 + 7); const int inf = (1e9 + 7); int l[N], r[N]; main(){ SPEEDUP; int n, A, B; cin >> n >> A >> B; for(int i = 1; i <= n; i++){ cin >> l[i] >> r[i]; } set<pair<int,int >> st; for(int i = 1;i <= n; i++){ for(int j = l[i], x, y; j <= r[i]; j++){ x = ((j + (j + B - 1) / B) % A); y = j % B; st.insert({x, y}); } } cout << st.size(); }

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

strange_device.cpp:19:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   19 | 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...