# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
728568 | grogu | Thousands Islands (IOI22_islands) | C++17 | 34 ms | 4188 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 "islands.h"
#define dbg(x) cerr<<#x<<": "<<x<<endl
#define ll int
#define pll pair<ll,ll>
#include <iostream>
#include <vector>
#include <variant>
#define pb push_back
using namespace std;
#define maxn 405
ll n,m;
vector<ll> g[maxn];
ll id[maxn][maxn];
variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) {
n = N;
m = M;
for(ll &x : U) x++;
for(ll &x : V) x++;
if(n==2){
vector<ll> cnt(3,0);
for(ll i = 0;i<m;i++){
ll x = U[i],y = V[i];
cnt[x]++;
}
return cnt[1]>=2&&cnt[2]>=1;
}
return n!=2;
for(ll i = 0;i<m;i++){
ll x = U[i],y = V[i];
g[x].pb(y);
g[y].pb(x);
id[x][y] = i;
}
}
Compilation message (stderr)
# | 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... |