이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "islands.h"
#include <variant>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
typedef vector<pi> pii;
typedef tuple<int,int,int> tii;
typedef vector<ll> li;
typedef vector<li> lii;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define LSOne(s) ((s)&(-s))
ll INF=1e18+10;
int inf=1e9+10;
ll M=1e9+7;
int n,m;
vi ans;
vector<pii> arr;
vi vis;
void bfs(int x){
return;
}
std::variant<bool, std::vector<int>> find_journey(
int N, int M, std::vector<int> U, std::vector<int> V) {
n=N;m=M;
if(n==2){
if(m<=2)return false;
vi a;
REP(i,0,m)if(U[i]==0)a.PB(i);
int p=-1;
REP(i,0,m)if(U[i]!=0)p=i;
int k=a.size();
if(k<2||p==-1)return false;
ans.PB(a[0]);ans.PB(p);ans.PB(a[1]);ans.PB(a[0]);ans.PB(p);ans.PB(a[1]);
return ans;
}
arr.resize(n);
REP(i,0,m){
arr[U[i]].PB({V[i],i});
arr[V[i]].PB({U[i],i});
}
if(arr[0].size()>=2){
int x=arr[0][0].S;
int y=arr[arr[0][0].F][0].S;
int c=arr[0][1].S;
int d=arr[arr[0][1].F][0].S;
ans.PB(x);ans.PB(y);ans.PB(c);ans.PB(d);ans.PB(y);ans.PB(x);ans.PB(d);ans.PB(c);
return ans;
}
vis.resize(n,0);
bfs(0);
return false;
}
# | 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... |