제출 #1170685

#제출 시각아이디문제언어결과실행 시간메모리
1170685thelegendary08수천개의 섬 (IOI22_islands)C++17
6.75 / 100
18 ms3396 KiB
#include "islands.h" #include<bits/stdc++.h> #define vi vector<int> #define pb push_back #define FOR(i, k, n) for(int i = k; i<n; i++) #define f0r(i,n) for(int i = 0; i< n; i++) #define mp make_pair using namespace std; std::variant<bool, std::vector<int>> find_journey( int n, int m, std::vector<int> u, std::vector<int> v) { if (n == 2) { int c1 = 0; int c2 = 0; f0r(i, m){ if(u[i] == 0)c1++; else c2++; } if(c1 >= 2 && c2 >= 1){ int a = -1; int b = -1; int c = -1; f0r(i,m){ if(u[i] == 0){ if(a == -1)a = i; else b = i; } else c = i; } return vector<int>{a,c,b,a,c,b}; } else return false; } }

컴파일 시 표준 에러 (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:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
#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...