| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 907379 | lighton | Road Construction (JOI21_road_construction) | C++17 | 78 ms | 17956 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define forf(i,a,b) for(int i = a; i<=b; i++)
#define all(v) v.begin(),v.end()
#define fi first
#define se second
using namespace std;
typedef long long ll;
int N,K;
ll X[1000001],Y[1000001];
pair<ll,ll> Xind[1000001] , Yind[100001];
set<pair<ll,ll> > S;
ll inf = 1e18;
int main(){
scanf("%d %d" , &N,&K);
forf(i,1,N) scanf("%lld %lld" , &X[i] , &Y[i]);
forf(i,1,N){
ll x = X[i], y = Y[i];
X[i] = x+y;
Y[i] = x-y;
Xind[i] = {X[i],i};
Yind[i] = {Y[i],i};
}
sort(Xind+1,Xind+N+1); sort(Yind+1,Yind+N+1);
ll ans = inf;
forf(i,2,N){
ans = min(ans,Xind[i].fi-Xind[i-1].fi);
ans = min(ans,Yind[i].fi-Yind[i-1].fi);
}
printf("%lld" , ans);
}
컴파일 시 표준 에러 (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... | ||||
