# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
217933 | Autoratch | 이상한 기계 (APIO19_strange_device) | C++14 | 1540 ms | 178740 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 10;
int n;
long long a,b;
map<long long,int> ma;
set<long long> s;
int res[N];
vector<pair<long long,long long> > in;
long long rng[N],ans;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> a >> b;
a/=__gcd(a,b+1);
if(a>1e18/b) a = (1e18+2),b = 1;
for(int i = 0;i < n;i++)
{
long long x,y;
cin >> x >> y;
if(y-x+1LL>=a*b){ cout << a*b; return 0; }
y++;
x%=(a*b),y%=(a*b);
if(y<x) in.push_back({0LL,y}),in.push_back({x,a*b});
else in.push_back({x,y});
s.insert(x),s.insert(y);
# | 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... |