# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101620 | 2019-03-19T05:21:28 Z | dantoh000 | Adriatic (CEOI13_adriatic) | C++14 | 2000 ms | 263168 KB |
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> ii; int main(){ int n; scanf("%d",&n); int adjmat[n][n]; memset(adjmat,-1,sizeof(adjmat)); int x[n], y[n]; for (int i = 0; i < n; i++){ adjmat[i][i] = 0; scanf("%d%d",&x[i],&y[i]); for (int j = 0; j < i; j++){ if ((x[i]<x[j]&&y[i]<y[j]) || (x[i]>x[j]&&y[i]>y[j])){ //printf("%d %d con\n",i,j); adjmat[i][j] = adjmat[j][i] = 1; } } } int ans = 0; for (int k = 0; k < n; k++){ for (int i = 0; i < n; i++){ if (adjmat[i][k] == -1) continue; for (int j = i+1; j < n; j++){ if (adjmat[k][j] == -1) continue; if (adjmat[i][j]==-1) adjmat[j][i] = adjmat[i][j] = adjmat[i][k]+adjmat[k][j]; else adjmat[j][i] = adjmat[i][j] = min(adjmat[i][j],adjmat[i][k]+adjmat[k][j]); } } } for (int i = 0 ;i <n; i++){ int ans = 0; for (int j = 0; j < n; j++){ //printf("%d ",adjmat[i][j]); ans += adjmat[i][j]; } printf("%d\n",ans); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Correct | 3 ms | 384 KB | Output is correct |
4 | Correct | 3 ms | 384 KB | Output is correct |
5 | Correct | 3 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2044 ms | 9088 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2044 ms | 98168 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 208 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 384 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |