# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101531 | 2019-03-19T03:46:12 Z | errorgorn | Adriatic (CEOI13_adriatic) | C++14 | 2000 ms | 9240 KB |
#include <cstdio> #include <utility> #include <cstring> #include <algorithm> using namespace std; typedef pair<int,int> ii; int n; ii arr[1505]; int asps[1505][1505]; void print(){ for (int x=0;x<n;x++){ for (int y=0;y<n;y++) printf("%d ",asps[x][y]); printf("\n"); } } int main(){ //freopen("input.txt","r",stdin); memset(asps,63,sizeof(asps)); int a,b; scanf("%d",&n); for (int x=0;x<n;x++){ scanf("%d%d",&a,&b); arr[x]=ii(a,b); } for (int x=0;x<n;x++) for (int y=0;y<n;y++) if ((arr[x].first<arr[y].first && arr[x].second<arr[y].second)||(arr[x].first>arr[y].first && arr[x].second>arr[y].second)) asps[x][y]=1; for (int k=0;k<n;k++) for (int x=0;x<n;x++) for (int y=0;y<n;y++) asps[x][y]=min(asps[x][y],asps[x][k]+asps[k][y]); int _max; for (int x=0;x<n;x++){ _max=0; for (int y=0;y<n;y++){ if (x!=y) _max+=asps[x][y]; } printf("%d\n",_max); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 10 ms | 9216 KB | Output is correct |
2 | Correct | 13 ms | 9216 KB | Output is correct |
3 | Correct | 13 ms | 9216 KB | Output is correct |
4 | Correct | 12 ms | 9148 KB | Output is correct |
5 | Correct | 6 ms | 9216 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2070 ms | 9240 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 84 ms | 9220 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 465 ms | 9220 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 577 ms | 9216 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |