제출 #1042468

#제출 시각아이디문제언어결과실행 시간메모리
1042468yanb수천개의 섬 (IOI22_islands)C++17
1.75 / 100
15 ms6356 KiB
#include <bits/stdc++.h> using namespace std; //#define int long long //#define pii pair<long long, long long> union Ans { bool b; vector<int> v; Ans(bool b) : b(b) {} Ans(vector<int> v) : v(v) {} ~Ans() {} Ans(const Ans&) {} }; Ans n2(int n, int M, vector<int> U, vector<int> V) { vector<int> u0, u1; for (int i = 0; i < M; i++) { if (U[i]) u1.push_back(i); else u0.push_back(i); } if (u1.size() > 1 && u0.size() > 1) { vector<int> ans = {u0[0], u1[0], u0[1], u1[1], u1[0], u0[0], u1[1], u0[1]}; return ans; } else { return false; } } Ans find_journey(int n, int M, vector<int> U, vector<int> V) { if (n == 2) return n2(n, M, U, V); } #ifdef LOCAL signed main() { Ans ans = find_journey(2, 3, [0, 1, 1], [1, 0, 0]); cout << ans.b << "\n"; } #endif

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

islands.cpp: In function 'Ans 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...