# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
741573 | yeyso | Strange Device (APIO19_strange_device) | C++14 | 5054 ms | 524288 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n, a, b; cin >> n >> a >> b;
vector<pair<long long, long long>> periods;
long long l, r;
long long time = 0;
for(long long i = 0; i < n; i ++){
cin >> l >> r;
periods.push_back({l, r});
}
time = periods[periods.size()-1].second;
set<pair<long long, long long>> res;
long long x, y;
for(long long i = 0; i < n; i ++){
for(long long t = periods[i].first; t <= periods[i].second; t ++){
x = (t + (t/b)) % a;
y = t % b;
res.insert({x, y});
}
}
cout << res.size();
}
/*
g++ -std=gnu++17 -O2 -pipe -static -o device device.cpp
3 3 3
4 4
7 9
17 18
*/
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |