제출 #632021

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

int n,m;
vector<int> u,v;

variant<bool, std::vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) {

  n=N,m=M,u=U,v=V;
  if (n==2) {
    vector<int> fv,sv;
    for (int x=0; x<m; ++x) if (u[x]==0) fv.push_back(x); else sv.push_back(x);
      int f=fv.size(), s=sv.size();
    if (f>=2 && s) {
      vector<int> r={fv[0],sv[0],fv[1],fv[0],sv[0],fv[1]};;
      return r;
    } 
    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:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
#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...