# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101564 | 2019-03-19T04:30:24 Z | ShaneOng | Adriatic (CEOI13_adriatic) | C++14 | 2000 ms | 197216 KB |
#include<bits/stdc++.h> #define INF 100000009 using namespace std; int adjMat[5009][5009],n,col[5009],row[5009]; int main(){ scanf("%d",&n); for(int x=0,a,b;x<n;x++){ scanf("%d%d",&a,&b); row[x]=a; col[x]=b; for(int y=0;y<x;y++){ if(((row[x]>row[y])&&(col[x]>col[y]))||((row[x]<row[y])&&(col[x]<col[y]))){ adjMat[x][y]=1; adjMat[y][x]=1; }else{ adjMat[x][y]=INF; adjMat[y][x]=INF; } } } for(int k=0;k<n;k++) for(int i=0;i<n;i++) for(int j=0;j<n;j++) adjMat[i][j]=min(adjMat[i][j],adjMat[i][k]+adjMat[k][j]); for(int x=0;x<n;x++){ int sum=0; for(int y=0;y<n;y++) sum+=adjMat[x][y]; printf("%d\n",sum); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 768 KB | Output is correct |
2 | Correct | 5 ms | 768 KB | Output is correct |
3 | Correct | 4 ms | 768 KB | Output is correct |
4 | Correct | 4 ms | 768 KB | Output is correct |
5 | Correct | 4 ms | 768 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2033 ms | 15232 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2037 ms | 98428 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 580 ms | 197156 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 | 610 ms | 197216 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |