# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
25629 | 2017-06-23T09:11:49 Z | Extazy | Adriatic (CEOI13_adriatic) | C++14 | 2000 ms | 193480 KB |
#include <bits/stdc++.h> using namespace std; const int N = 7000; const int INF = (1e9) + 7; int n,d[N][N]; pair < int, int > a[N]; int main() { int i,j,z; scanf("%d", &n); for(i=1;i<=n;i++) { scanf("%d %d", &a[i].first, &a[i].second); } for(i=1;i<=n;i++) { for(j=i+1;j<=n;j++) { if((a[i].first>a[j].first && a[i].second>a[j].second) || (a[i].first<a[j].first && a[i].second<a[j].second)) { d[i][j]=d[j][i]=1; } } } for(i=1;i<=n;i++) for(j=1;j<=n;j++) if(i!=j && d[i][j]==0) d[i][j]=INF; for(z=1;z<=n;z++) { for(i=1;i<=n;i++) { for(j=i+1;j<=n;j++) { d[i][j]=min(d[i][j],d[i][z]+d[z][j]); d[j][i]=min(d[j][i],d[j][z]+d[z][i]); } } } for(i=1;i<=n;i++) { long long sum=0; for(j=1;j<=n;j++) if(i!=j) sum+=d[i][j]; printf("%lld\n", sum); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 193480 KB | Output is correct |
2 | Correct | 3 ms | 193480 KB | Output is correct |
3 | Correct | 0 ms | 193480 KB | Output is correct |
4 | Correct | 0 ms | 193480 KB | Output is correct |
5 | Correct | 0 ms | 193480 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2000 ms | 193480 KB | Execution timed out |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2000 ms | 193480 KB | Execution timed out |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 9 ms | 193480 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 73 ms | 193480 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |