# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
480476 | 2021-10-16T14:30:27 Z | dsyz | 컴퓨터 네트워크 (BOI14_network) | C++17 | 114 ms | 7896 KB |
#include "network.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define MAXN (1005) void findRoute (int N, int a, int b){ int dist = ping(a, b); ll from[N + 1]; for(int i = 1;i <= N;i++){ if(i != a && i != b){ int fromend = ping(i,b); from[i] = fromend; } } int cur = a; int prev = dist; int visited[N + 1]; memset(visited,0,sizeof(visited)); visited[a] = 1; visited[b] = 1; for (int w = 0;w < dist;w++){ for(int i = 1;i <= N;i++){ if(i == a || i == b){ continue; } if(visited[i] == 0 && from[i] == prev - 1 && ping(cur,i) == 0){ visited[i] = 1; prev--; cur = i; break; } } travelTo(cur); } travelTo(b); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 91 ms | 7876 KB | Output is correct |
2 | Correct | 100 ms | 7432 KB | Output is correct |
3 | Correct | 84 ms | 6964 KB | Output is correct |
4 | Correct | 95 ms | 7012 KB | Output is correct |
5 | Correct | 82 ms | 6700 KB | Output is correct |
6 | Correct | 92 ms | 6704 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 332 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 304 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 94 ms | 6620 KB | Output is correct |
2 | Correct | 23 ms | 2756 KB | Output is correct |
3 | Correct | 86 ms | 7748 KB | Output is correct |
4 | Correct | 78 ms | 6088 KB | Output is correct |
5 | Correct | 86 ms | 7876 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 101 ms | 6656 KB | Output is correct |
2 | Correct | 23 ms | 2820 KB | Output is correct |
3 | Correct | 98 ms | 7696 KB | Output is correct |
4 | Correct | 84 ms | 6084 KB | Output is correct |
5 | Correct | 113 ms | 7896 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 91 ms | 6628 KB | Output is correct |
2 | Correct | 30 ms | 2756 KB | Output is correct |
3 | Correct | 107 ms | 7796 KB | Output is correct |
4 | Correct | 114 ms | 6084 KB | Output is correct |
5 | Correct | 103 ms | 7828 KB | Output is correct |