이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "islands.h"
#include <variant>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define f0(i, n) for(int i = 0; i < (n); i++)
#define f1(i, n) for(int i = 1; i <= (n); i++)
#define ff first
#define ss second
#define pb push_back
int opp(int n) {
if(n % 2 == 0) return n+1;
return n-1;
}
std::variant<bool, std::vector<int>> find_journey(
int N, int M, std::vector<int> U, std::vector<int> V) {
if(N == 2) {
vi zr, on;
f0(i, M) {
if(U[i] == 0) zr.pb(i);
else on.pb(i);
}
if(zr.size() < 2 || on.size() < 1) return false;
return vi({zr[0], on[0], zr[1], zr[0], on[0], zr[1]});
}
bool sbtsk3 = (M % 2 == 0);
bool sbtsk4 = (M % 2 == 0);
f0(i, M - 1) {
if(i % 2 == 0) {
if(U[i] != V[i+1] || V[i] != U[i+1]) {
sbtsk3 = false;
}
if(U[i] != U[i+1] || V[i] != V[i+1]) {
sbtsk4 = false;
}
}
}
if (N == 4) {
return std::vector<int>({0, 1, 2, 4, 0, 3, 2, 1, 4, 3});
}
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:37:10: warning: variable 'sbtsk3' set but not used [-Wunused-but-set-variable]
37 | bool sbtsk3 = (M % 2 == 0);
| ^~~~~~
islands.cpp:38:10: warning: variable 'sbtsk4' set but not used [-Wunused-but-set-variable]
38 | bool sbtsk4 = (M % 2 == 0);
| ^~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |