# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
383175 | kshitij_sodani | City (JOI17_city) | C++14 | 528 ms | 57428 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#define endl '\n'
#include "Encoder.h"
vector<llo> adj[250001];
llo co=0;
llo st[250001];
llo endd[250001];
void dfs(llo no,llo par2=-1){
st[no]=co;
for(auto j:adj[no]){
if(j!=par2){
dfs(j,no);
}
}
co++;
endd[no]=co-1;
}
void Encode(int n, int aa[], int bb[])
{
for(int i=0;i<n-1;i++){
adj[aa[i]].pb(bb[i]);
adj[bb[i]].pb(aa[i]);
}
dfs(0);
for (int i = 0; i < n; ++i) {
Code(i, st[i]*250000+endd[i]);
}
}
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#define endl '\n'
#include "Device.h"
void InitDevice()
{
}
int Answer(long long S, long long T)
{ llo xx2=250000;
pair<llo,llo> xx={S/xx2,S%xx2};
pair<llo,llo> yy={T/xx2,T%xx2};
//0 if T is parent of S
//1 if S is parent of T
if(yy.a>=xx.a and yy.b<=xx.b){
return 1;
}
if(yy.a<=xx.a and yy.b>=xx.b){
return 0;
}
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |