# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1007076 | 2024-06-24T11:26:43 Z | 3as8 | 가장 긴 여행 (IOI23_longesttrip) | C++17 | 888 ms | 596 KB |
#include "longesttrip.h" #include<bits/stdc++.h> #define ll long long using namespace std; bool con[300][300]; bool vis[300]; bool bkVis[300]; ll n; ll l = 0; void dfs(int startIndex, vector<int>& curr) { vis[startIndex] = true; curr.push_back(startIndex); bool in = false; for(int i = 0; i < n; i++) { if(con[startIndex][i] && !vis[i]) { dfs(i, curr); in = true; } } if(!in) l = startIndex; } std::vector<int> longest_trip(int N, int D) { n = N; for(int i = 0; i < n; i++) { for(int j = i + 1; j < n; j++) { con[i][j] = con[j][i] = are_connected({i}, {j}); } } ll mx = LLONG_MIN; vector<int> ans; // for(int i = 0; i < n; i++) vis[i] = false; for(int i = 0; i < n; i++) { for(int i = 0; i < n; i++) vis[i] = false; vector<int> curr; dfs(i, curr); if(curr.size() > ans.size()) { ans = curr; } } return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 214 ms | 488 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 344 KB | Output is correct |
2 | Correct | 31 ms | 344 KB | Output is correct |
3 | Correct | 130 ms | 344 KB | Output is correct |
4 | Correct | 392 ms | 508 KB | Output is correct |
5 | Correct | 833 ms | 496 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 344 KB | Output is correct |
2 | Correct | 21 ms | 344 KB | Output is correct |
3 | Correct | 152 ms | 344 KB | Output is correct |
4 | Correct | 406 ms | 596 KB | Output is correct |
5 | Correct | 877 ms | 492 KB | Output is correct |
6 | Incorrect | 0 ms | 344 KB | Incorrect |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 344 KB | Output is correct |
2 | Correct | 26 ms | 344 KB | Output is correct |
3 | Correct | 146 ms | 344 KB | Output is correct |
4 | Correct | 416 ms | 448 KB | Output is correct |
5 | Correct | 888 ms | 488 KB | Output is correct |
6 | Incorrect | 0 ms | 344 KB | Incorrect |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 344 KB | Output is correct |
2 | Correct | 21 ms | 344 KB | Output is correct |
3 | Partially correct | 156 ms | 344 KB | Output is partially correct |
4 | Partially correct | 446 ms | 592 KB | Output is partially correct |
5 | Partially correct | 882 ms | 488 KB | Output is partially correct |
6 | Incorrect | 1 ms | 344 KB | Incorrect |
7 | Halted | 0 ms | 0 KB | - |