# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1058829 | jamjanek | City (JOI17_city) | C++14 | 188 ms | 53772 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Encoder.h"
#include<bits/stdc++.h>
using namespace std;
vector<int>graf[250010];
int preorder[250010], post[250010], preit, postit;
void dfs(int x, int o){
preorder[x]=preit++;
for(auto j: graf[x])
if(j!=o)
dfs(j, x);
post[x]=postit++;
}
void Encode(int n, int A[], int B[])
{
int i;
for(i=0;i<n-1;i++){
graf[A[i]].push_back(B[i]);
graf[B[i]].push_back(A[i]);
}
dfs(0,-1);
for (int i = 0; i < n; ++i) {
Code(i, (long long)preorder[i]*250000+post[i]);
}
}
#include "Device.h"
#include<bits/stdc++.h>
using namespace std;
void InitDevice()
{
}
int Answer(long long S, long long T)
{
int X1=S/250000, X2=S%250000;
int Y1=T/250000, Y2=T%250000;
if(X1<=Y1 && X2>=Y2)return 1;
if(Y1<=X1 && Y2>=X2)return 0;
return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |