| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1082433 | ZeroCool | Portal (BOI24_portal) | C++14 | 19 ms | 2392 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ar array
#define int long long
#define ld long double
#define crash assert(69 == 420)
const int MOD = 1e9 + 7;
const int INF = 1e9;
const int N = 2e5 + 20;
signed main(){ios_base::sync_with_stdio(false);cin.tie(0);
int n;
cin>>n;
int mx, my;
int a = 0, b = 0, c = 0;
cin>>mx>>my;
--n;
while(n--){
int x, y;
cin>>x>>y;
x -= mx, y -= my;
while(x){
int d = a / x;
a -= d * x, b -= d * y;
swap(a, x);
swap(b, y);
}
while(y){
c %= y;
swap(c, y);
}
if(c != 0)b %= c;
}
if(a == 0 || c == 0)cout<<-1;
else cout<<abs(a * c);
}| # | 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... | ||||
