# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
840765 | happypotato | Longest Trip (IOI23_longesttrip) | C++17 | 18 ms | 716 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "longesttrip.h"
#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
// #define int long long // remove when necessary
#define pii pair<int, int>
#define ff first
#define ss second
#define pb push_back
#define ll long long
const int mxN = 256;
vector<int> adj[mxN];
vector<int> grp[mxN];
int conn[mxN][mxN];
int callcnt;
bool con(int x, int y) {
// cerr << "CALLx " << x << ' ' << y << endl;
if (x == y) return (conn[x][x] = 1);
if (conn[x][y] != -1) return conn[x][y];
callcnt++;
return (conn[x][y] = conn[y][x] = are_connected({x}, {y}));
}
bool Con(vector<int> x, vector<int> y) {
if (x.size() == 1 && y.size() == 1) {
return con(x[0], y[0]);
}
// cerr << "CALL\n";
// for (int &cur : x) cerr << cur << ' ';
// cerr << endl;
# | 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... |