이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
#define pb push_back
#define popb pop_back
#define all(x) (x).begin(),(x).end()
#define ff first
#define ss second
vi label(int n, int k, vi u, vi v)
{
vi rep;
for(int i = 0; i < n; i++)
{
rep.pb(i);
}
return rep;
}
int find_next_station(int s, int t, vi c)
{
set<int> st;
int cur = t;
while(cur != 0)
{
st.insert(cur);
if(cur & 1)
{
cur /= 2;
}
else
{
cur = cur/2 - 1;
}
}
st.insert(cur);
if(st.count(s) != 0)
{
if(st.count(( s + 1) * 2) != 0)
return ((s + 1) * 2);
else
return s * 2 + 1;
}
else
{
if(s & 1)
return s/2;
else
return s/2 - 1;
}
}
# | 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... |