제출 #1077411

#제출 시각아이디문제언어결과실행 시간메모리
1077411Faisal_Saqib수천개의 섬 (IOI22_islands)C++17
10 / 100
100 ms21540 KiB
#include <bits/stdc++.h> #include <variant> #include <vector> using namespace std; std::variant<bool, std::vector<int>> find_journey(int N, int M, std::vector<int> v1, std::vector<int> v2) { int n=N,m=M; map<pair<int,int>,vector<int>> cnt; for(int j=0;j<m;j++) cnt[{v1[j],v2[j]}].push_back(j); if(n>2) { int edge01=cnt[{0,1}][0]; int edge10=cnt[{1,0}][0]; int edge02=cnt[{0,2}][0]; int edge20=cnt[{2,0}][0]; int edge12=cnt[{1,2}][0]; int edge21=cnt[{2,1}][0]; return vector<int>({edge01,edge12,edge20,edge02,edge21,edge10,edge20,edge12,edge01,edge10,edge21,edge02}); } else if(cnt[{0,1}].size()>=2 and cnt[{1,0}].size()>=1) { int f=cnt[{0,1}][0]; int s=cnt[{0,1}][1]; int th=cnt[{1,0}][0]; return vector<int>({f,th,s,f,th,s}); } else { return false; } }
#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...