제출 #1077866

#제출 시각아이디문제언어결과실행 시간메모리
1077866pcc수천개의 섬 (IOI22_islands)C++17
10 / 100
24 ms9040 KiB
#include "islands.h" #include <variant> #include <vector> #include <bits/stdc++.h> using namespace std; #define pii pair<int,int> #define fs first #define sc second std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { if(N == 2){ vector<int> cnt[2]; for(int i = 0;i<M;i++){ int a = U[i],b = V[i]; cnt[a].push_back(i); } if(cnt[0].size()<2||cnt[1].size()<1)return false; int x = cnt[0][0],y = cnt[1][0],z = cnt[0][1]; return vector<int>({x,y,z,x,y,z}); } else{ if(N<=2)return false; int mxn = 440; int arr[mxn][mxn]; for(int i = 0;i<M;i++){ int a = U[i],b = V[i]; arr[a][b] = i; } pii a = pii(arr[0][1],arr[1][0]),b = pii(arr[1][2],arr[2][1]),c = pii(arr[2][0],arr[0][2]); return vector<int>({a.fs,b.fs,c.fs,c.sc,b.sc,a.sc,c.fs,b.fs,a.fs,a.sc,b.sc,c.sc}); } }

컴파일 시 표준 에러 (stderr) 메시지

islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, std::vector<int>, std::vector<int>)':
islands.cpp:16:17: warning: unused variable 'b' [-Wunused-variable]
   16 |    int a = U[i],b = V[i];
      |                 ^
#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...