제출 #1182334

#제출 시각아이디문제언어결과실행 시간메모리
1182334PagodePaivaThousands Islands (IOI22_islands)C++20
5 / 100
20 ms7496 KiB
#include "islands.h"
#include<bits/stdc++.h>
#include <variant>
#include <vector>

using namespace std;

const int N = 100010;
vector <pair <int, int>> g[N];

std::variant<bool, std::vector<int>> find_journey(int N, int M, std::vector<int> U, std::vector<int> V) {
    if(N == 2) return false;
    int a[2], b[2], c[2];
    for(int i = 0;i < M;i++){
        if(U[i] == 0 and V[i] == 1) a[0] = i;
        if(U[i] == 1 and V[i] == 0) a[1] = i;
        if(U[i] == 1 and V[i] == 2) b[0] = i;
        if(U[i] == 2 and V[i] == 1) b[1] = i;
        if(U[i] == 2 and V[i] == 0) c[0] = i;
        if(U[i] == 0 and V[i] == 2) c[1] = i;
        g[U[i]].push_back({V[i], i});
    }
    vector <int> ans = {a[0], b[0], c[0], c[1], b[1], a[1], c[0], b[0], a[0], a[1], b[1], c[1]};
    return ans;
}
#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...