Submission #776586

#TimeUsernameProblemLanguageResultExecution timeMemory
776586SanguineChameleonThousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include "islands.h"
#include <bits/stdc++.h>

variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) {
	if (N == 2) {
		vector<int> left;
		vector<int> right;
		for (int i = 0; i < M; i++) {
			if (U[i] == 0) {
				left.push_back(i);
			}
			else {
				right.push_back(i);
			}
		}
		if ((int)left.size() < 2 || right.empty()) {
			return false;
		}
		int A = left[0];
		int B = right[0];
		int C = left[1];
		return {A, B, C, A, B, C};
	}
	return false;
}

Compilation message (stderr)

islands.cpp:4:1: error: 'variant' does not name a type
    4 | variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) {
      | ^~~~~~~