# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
994860 | 2024-06-08T07:46:48 Z | 김은성(#10865) | Longest Trip (IOI23_longesttrip) | C++17 | 870 ms | 1132 KB |
#include "longesttrip.h" #include <bits/stdc++.h> using namespace std; vector<int> graph[299]; bool ch[299]; vector<int> path; void dfs(int v){ ch[v] = 1; path.push_back(v); int i; for(i=0; i<graph[v].size(); i++){ int u = graph[v][i]; if(!ch[u]){ dfs(u); return; } } } std::vector<int> longest_trip(int N, int D){ int i, j; for(i=0; i<N; i++){ graph[i].clear(); ch[i] = 0; } for(i=0; i<N; i++){ for(j=i+1; j<N; j++){ if(are_connected({i}, {j})){ graph[i].push_back(j); graph[j].push_back(i); } } } path.clear(); dfs(0); return path; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 192 ms | 980 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 344 KB | Output is correct |
2 | Correct | 16 ms | 344 KB | Output is correct |
3 | Correct | 129 ms | 344 KB | Output is correct |
4 | Correct | 423 ms | 604 KB | Output is correct |
5 | Correct | 762 ms | 704 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 344 KB | Output is correct |
2 | Correct | 22 ms | 344 KB | Output is correct |
3 | Correct | 156 ms | 600 KB | Output is correct |
4 | Correct | 417 ms | 704 KB | Output is correct |
5 | Correct | 747 ms | 856 KB | Output is correct |
6 | Incorrect | 0 ms | 344 KB | Incorrect |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 344 KB | Output is correct |
2 | Correct | 23 ms | 344 KB | Output is correct |
3 | Correct | 157 ms | 600 KB | Output is correct |
4 | Correct | 419 ms | 600 KB | Output is correct |
5 | Correct | 828 ms | 892 KB | Output is correct |
6 | Correct | 7 ms | 344 KB | Output is correct |
7 | Correct | 16 ms | 344 KB | Output is correct |
8 | Correct | 133 ms | 344 KB | Output is correct |
9 | Correct | 310 ms | 344 KB | Output is correct |
10 | Correct | 834 ms | 488 KB | Output is correct |
11 | Correct | 856 ms | 856 KB | Output is correct |
12 | Correct | 836 ms | 1132 KB | Output is correct |
13 | Correct | 870 ms | 720 KB | Output is correct |
14 | Correct | 4 ms | 344 KB | Output is correct |
15 | Incorrect | 3 ms | 344 KB | Incorrect |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 344 KB | Output is correct |
2 | Correct | 22 ms | 344 KB | Output is correct |
3 | Partially correct | 150 ms | 344 KB | Output is partially correct |
4 | Partially correct | 395 ms | 476 KB | Output is partially correct |
5 | Partially correct | 858 ms | 1084 KB | Output is partially correct |
6 | Incorrect | 0 ms | 344 KB | Incorrect |
7 | Halted | 0 ms | 0 KB | - |