제출 #797655

#제출 시각아이디문제언어결과실행 시간메모리
797655Joshi503수천개의 섬 (IOI22_islands)C++17
0 / 100
2 ms468 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

struct datos{
	bool ok;
	vector<int> v;
};

/*

	ida 1 2
	regreso 3 4

	1 3 2 1 3 2

*/

struct datos find_journey(int N, int M, vector<int> U, vector<int> V){
	if(N == 2){
		datos res;
		res.ok = 0;
		if(M == 1) return res;
		vector<int> ida, regreso;
		for(int i = 0; i < M; i++){
			if(U[i] == 0 && V[i] == 1) ida.push_back(i);
			else regreso.push_back(i);
		}
		vector<int> x;
		if((int)ida.size() >= 2 && (int)(regreso.size())){
			res.ok = 1;
			x = {ida[0], regreso[0], ida[1], ida[0], regreso[0], ida[1]};
			res.v = x;
		}
		return res;
	}
}

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

islands.cpp: In function 'datos find_journey(int, int, std::vector<int>, std::vector<int>)':
islands.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
   38 | }
      | ^
#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...