Submission #971023

#TimeUsernameProblemLanguageResultExecution timeMemory
971023ALeonidouThousands Islands (IOI22_islands)C++17
5 / 100
28 ms5704 KiB
#include "islands.h" #include <variant> #include <vector> #include <iostream> using namespace std; #define ll int #define F first #define S second #define pb push_back #define sz(x) (ll)x.size() #define endl "\n" typedef vector <ll> vi; typedef pair <ll, ll> ii; typedef vector <ii> vii; #define dbg(x) cout<<#x<<": "<<x<<endl; #define dbg2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl; #define dbg3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<endl; void printVct(vi &v){ for (ll i =0; i<sz(v); i++){ cout<<v[i]<<" "; } cout<<endl; } ll n,m; vi u,v; variant<bool, vi> find_journey(int N, int M, vi U, vi V){ ll n = N, m = M; u = U, v = V; // printVct(u); // printVct(v); if (n == 2){ ll f0 = 0, f1= 0; vi a(3,-1); for (ll i =0; i<m; i++){ if (!u[i]){ f0++; if (a[0] == -1){ a[0] = i; } else if (a[1] == -1){ a[1] = i; } } else{ f1++; if (a[2] == -1){ a[2] = i; } } } // dbg2(f0, f1); // printVct(a); if (f0 >= 2 && f1 >= 1){ return vi({a[0], a[2], a[1], a[0], a[2], a[1]}); } else{ return false; } } return false; } /* 2 3 0 1 1 0 1 0 2 3 0 1 0 1 1 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...