# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1170249 | antonn | Longest Trip (IOI23_longesttrip) | C++20 | 324 ms | 632 KiB |
#include "longesttrip.h"
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
template<class T> bool ckmin(T& a, T b) { return b < a ? a = b, true : false; }
template<class T> bool ckmax(T& a, T b) { return a < b ? a = b, true : false; }
const int NMAX = 3e2 + 7;
vector<int> g[NMAX];
bool vis[NMAX];
void dfs(int u) {
vis[u] = 1;
for (auto v : g[u]) if (!vis[v]) dfs(v);
}
vector<int> longest_trip(int n, int d) {
for (int i = 0; i < n; ++i) vis[i] = 0, g[i].clear();
vector<vector<bool>> edge(n, vector<bool>(n, 0));
vector<int> deg(n);
ll sumdeg = 0;
for (int i = 0; i < n; ++i) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |