Submission #1247564

#TimeUsernameProblemLanguageResultExecution timeMemory
1247564m5588ohammedThousands Islands (IOI22_islands)C++20
5 / 100
74 ms18248 KiB
#include "islands.h"
#include <bits/stdc++.h>
using namespace std;
int n,m;
vector <int> v[200001];
map <array<int,2>,int> mp;

std::variant<bool, std::vector<int>> find_journey(int N, int M, std::vector<int> U, std::vector<int> V) {
	n=N,m=M;
	for(int i=0;i<m;i++){
		v[U[i]].push_back(V[i]);
		mp[{U[i],V[i]}]=i;
	}
	if(n==2) return false;
	vector <int> ans={mp[{0,1}],mp[{1,0}],mp[{0,2}],mp[{2,1}],mp[{0,1}],mp[{1,0}],mp[{2,1}],mp[{0,2}]};
	return ans;
}
// 6 12
// 0 3
// 3 0
// 3 2
// 2 3
// 1 2
// 2 1
// 1 4
// 4 1
// 5 4
// 4 5
// 2 5
// 5 2
#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...