제출 #658885

#제출 시각아이디문제언어결과실행 시간메모리
658885coding_snorlax수천개의 섬 (IOI22_islands)C++17
10 / 100
33 ms3412 KiB
#include<bits/stdc++.h> #include "islands.h" using namespace std; variant<bool, std::vector<int>> find_journey(int N,int M,vector<int> U,vector<int> V){ if(N==2){ int Back=-1; int Front_1=-1; int Front_2=-1; vector<int> S; for(int i=0;i<M;i++){ if(!(Back+1) && U[i]==1) Back=i; else if(!(Front_1+1) && V[i]==1) Front_1=i; else if(!(Front_2+1) && V[i]==1) Front_2=i; } if(!(Back+1) || !(Front_1+1) || !(Front_2+1)) return false; S.push_back(Front_1); S.push_back(Back); S.push_back(Front_2); S.push_back(Front_1); S.push_back(Back); S.push_back(Front_2); return S; } int find_0_1=-1; int find_0_2=-1; int find_1_0=-1; int find_2_0=-1; //vector<int> S; for(int i=0;i<M;i++){ if(!(find_0_1+1) && U[i]==0 && V[i]==1) find_0_1=i; else if(!(find_0_2+1) && U[i]==0 && V[i]==2) find_0_2=i; else if(!(find_1_0+1) && U[i]==1 && V[i]==0) find_1_0=i; else if(!(find_2_0+1) && U[i]==2 && V[i]==0) find_2_0=i; } //if(!(Back+1) || !(Front_1+1) || !(Front_2+1)) return S; vector<int> S={find_0_1,find_1_0,find_0_2,find_2_0,find_1_0,find_0_1,find_2_0,find_0_2}; return S; }
#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...