# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
101513 | 2019-03-19T03:29:50 Z | dwsc | 섬 항해 (CEOI13_adriatic) | C++14 | 2000 ms | 263168 KB |
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> ii; int main(){ int n; cin >> n; ii arr[n]; vector<int> adj[n]; for (int i = 0; i < n; i++){ cin >> arr[i].first >> arr[i].second; for (int j = 0; j < i; j++){ if ((arr[j].first<arr[i].first)&&(arr[j].second<arr[i].second)||(arr[j].first>arr[i].first)&&(arr[j].second>arr[i].second)){ adj[j].push_back(i); adj[i].push_back(j); // cout<< i << " " << j << "hi\n"; } } } for (int i = 0; i < n; i++){ queue<int> q; q.push(i); int dist[n]; memset(dist,-1,sizeof(dist)); dist[i] = 0; int sum = 0; while (!q.empty()){ int u = q.front(); q.pop(); for (int i = 0; i < adj[u].size(); i++){ int v = adj[u][i]; if (dist[v] == -1){ dist[v] = dist[u]+1; sum += dist[v]; q.push(v); } } } cout << sum << "\n"; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 256 KB | Output is correct |
2 | Correct | 3 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 284 KB | Output is correct |
4 | Correct | 3 ms | 384 KB | Output is correct |
5 | Correct | 3 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 318 ms | 1080 KB | Output is correct |
2 | Execution timed out | 2045 ms | 6808 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2045 ms | 5008 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2041 ms | 203224 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1410 ms | 263168 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |