# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101605 | SomeoneUnknown | Adriatic (CEOI13_adriatic) | C++14 | 2047 ms | 263168 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
ii mii(int b, int c){
return make_pair(b,c);
}
int main(){
int n;
scanf("%d", &n);
ii ilands[n];
int dist[n][n];
for(int i = 0; i < n; i++){
int x, y;
scanf("%d %d", &x, &y);
ilands[i] = mii(x,y);
for(int j = 0; j < i; j++){
if((x > ilands[j].first && y > ilands[j].second) || (x < ilands[j].first && y < ilands[j].second)){
dist[i][j] = dist[j][i] = 1;
}else{
dist[i][j] = dist[j][i] = n+5;
}
}
dist[i][i] = 0;
}
for(int k = 0; k < n; k++)
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
for(int i = 0; i < n; i++){
int tal = 0;
for(int j = 0; j < n; j++){
tal += dist[i][j];
}
printf("%d\n", tal);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |