Submission #825660

#TimeUsernameProblemLanguageResultExecution timeMemory
825660PixelCatThousands Islands (IOI22_islands)C++17
6.75 / 100
33 ms4396 KiB
#include "islands.h"

#ifdef NYAOWO
#include "grader.cpp"
#endif

#include <bits/stdc++.h>
#define For(i, a, b) for(int i = a; i <= b; i++)
#define Forr(i, a, b) for(int i = a; i >= b; i--)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
#define eb emplace_back
// #define int LL
using namespace std;
using i32 = int32_t;
using LL = long long;
using pii = pair<int, int>;

variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) {
    // if (N == 4) {
    //   return vector<int>({0, 1, 2, 4, 0, 3, 2, 1, 4, 3});
    // }
    // return false;
    vector<int> e0, e1;
    For(i, 0, M - 1) {
        if(U[i] == 0) e0.eb(i);
        else e1.eb(i);
    }
    if(sz(e0) >= 2 && sz(e1) >= 1) {
        int a = e0[0], b = e0[1];
        int c = e1[0];
        return vector<int>({b, c, a, b, c, a});
    }
    return false;
}

/*

4 5
0 1
1 2
2 3
0 3
3 1

1
10
0 1 2 4 0 3 2 1 4 3


2 3
0 1
1 0
1 0

0
0

*/
#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...