# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
42570 | 2018-02-28T09:08:37 Z | nonocut | Adriatic (CEOI13_adriatic) | C++14 | 2000 ms | 262144 KB |
#include<bits/stdc++.h> using namespace std; #define pii pair<int,int> #define X first #define Y second const int maxv = 2500; const int maxn = 250000 + 5; struct node { int x,y,id; }; int n; node p[maxn]; int pos[maxv+5]; vector<pii> way[maxn]; bool cmp(node a, node b) { if(a.x!=b.x) return a.x<b.x; return a.y>b.y; } int main() { scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d%d",&p[i].x,&p[i].y), p[i].id = i; sort(&p[1],&p[n+1],cmp); for(int i=1;i<=n;i++) { int cur = 0; for(int y=p[i].y-1;y>=1;y--) { if(pos[y]>cur) { cur = pos[y]; way[p[i].id].push_back({p[pos[y]].id,1}); way[p[pos[y]].id].push_back({p[i].id,0}); } } pos[p[i].y] = i; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 6136 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 9 ms | 6368 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 16 ms | 6824 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 53 ms | 12528 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2051 ms | 262144 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |