# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1008701 | 2024-06-26T16:48:32 Z | Abito | Longest Trip (IOI23_longesttrip) | C++17 | 1000 ms | 564 KB |
#include "longesttrip.h" #include <bits/stdc++.h> #define pb push_back using namespace std; std::vector<int> longest_trip(int n, int D) { vector<int> v; vector<bool> vis(n); v.pb(0); bool adj[n][n],calc[n][n]; for (int i=0;i<n;i++) for (int j=0;j<n;j++) adj[i][j]=calc[i][j]=0; while (v.size()<n){ vis[v.back()]=1; for (int i=0;i<n;i++){ if (vis[i]) continue; if (calc[v.back()][i]){ if (adj[v.back()][i]){ v.pb(i); break; } continue; } vector<int> x,y;x.pb(v.back());y.pb(i); calc[v.back()][i]=calc[i][v.back()]=true; adj[v.back()][i]=adj[i][v.back()]=are_connected(x,y); if (!adj[v.back()][i]) continue; v.pb(i); break; } } return v; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3050 ms | 344 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 344 KB | Output is correct |
2 | Correct | 5 ms | 344 KB | Output is correct |
3 | Correct | 5 ms | 344 KB | Output is correct |
4 | Correct | 5 ms | 344 KB | Output is correct |
5 | Correct | 5 ms | 564 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 344 KB | Output is correct |
2 | Correct | 5 ms | 344 KB | Output is correct |
3 | Correct | 4 ms | 344 KB | Output is correct |
4 | Correct | 5 ms | 344 KB | Output is correct |
5 | Correct | 8 ms | 344 KB | Output is correct |
6 | Execution timed out | 3073 ms | 344 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 344 KB | Output is correct |
2 | Correct | 5 ms | 352 KB | Output is correct |
3 | Correct | 7 ms | 344 KB | Output is correct |
4 | Correct | 6 ms | 344 KB | Output is correct |
5 | Correct | 5 ms | 344 KB | Output is correct |
6 | Execution timed out | 3099 ms | 344 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 344 KB | Output is correct |
2 | Correct | 5 ms | 344 KB | Output is correct |
3 | Correct | 7 ms | 344 KB | Output is correct |
4 | Correct | 7 ms | 344 KB | Output is correct |
5 | Correct | 5 ms | 344 KB | Output is correct |
6 | Execution timed out | 3057 ms | 344 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |