제출 #786202

#제출 시각아이디문제언어결과실행 시간메모리
786202ono_de206수천개의 섬 (IOI22_islands)C++17
6.75 / 100
24 ms5536 KiB
#include "islands.h"
#include<bits/stdc++.h>
using namespace std;

#define in insert
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second

//#define int long long
 
typedef long long ll;
typedef vector<int> vi;
typedef set<int> si;
typedef multiset<int> msi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

variant<bool, vector<int>> find_journey(int n, int m, vector<int> U, vector<int> V) {
	if(n == 2) {
		vector<int> a0, a1;
		for(int i = 0; i < m; i++) {
			if(U[i] == 0) a0.pb(i);
			else a1.pb(i);
		}
		if(a0.size() >= 2 && a1.size() >= 1) return vector<int>{a0[0], a1[0], a0[1], a0[0], a1[0], a0[1]};
		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:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
#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...