# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
801809 | kirakaminski968 | Wiring (IOI17_wiring) | C++17 | 94 ms | 31216 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "wiring.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int INF = 1234567890;
int n;
pair<int,int> arr[1000005];
set<int> sa, sb;
int getnearest(int x){
int res = 2e9;
if(arr[x].second == 1){
auto p = sa.lower_bound(arr[x].first);
if(p != sa.end()){
res = min(res,*p-arr[x].first);
}
if(p != sa.begin()){
p--;
res = min(res,arr[x].first-*p);
}
}
else{
auto p = sb.lower_bound(arr[x].first);
if(p != sb.end()){
res = min(res,*p-arr[x].first);
}
if(p != sb.begin()){
p--;
res = min(res,arr[x].first-*p);
}
}
# | 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... |