Submission #797639

#TimeUsernameProblemLanguageResultExecution timeMemory
797639HunterXDThousands Islands (IOI22_islands)C++17
5 / 100
26 ms5164 KiB
#include <bits/stdc++.h>
using namespace std;

typedef int ll;
typedef vector<ll> vl;
typedef vector<vl> vll;

#define pb push_back
#define nd '\n';

variant<bool, vl> find_journey(ll n, ll m, vl u, vl v) {
  vl ans;

  if (n == 2) {
    vl grid[n][n];
    for (ll i = 0; i < m; i++) {
      grid[u[i]][v[i]].pb(i);
    }

    if (grid[0][1].size() >= 2 && grid[1][0].size() >= 1) {
      ans.pb(grid[0][1][0]);
      ans.pb(grid[1][0][0]);
      ans.pb(grid[0][1][1]);
      ans.pb(grid[0][1][0]);
      ans.pb(grid[1][0][0]);
      ans.pb(grid[0][1][1]);
      return ans;
    }
  }

  return false;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...