# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1080322 | LCJLY | City (JOI17_city) | C++14 | 355 ms | 42220 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Encoder.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
//#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,int>pi2;
//mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());
//Code(index,val)
vector<int>adj[250005];
int in[250005];
int out[250005];
int ptr=-1;
void dfs(int index, int par){
in[index]=++ptr;
for(auto it:adj[index]){
if(it==par) continue;
dfs(it,index);
}
out[index]=ptr;
}
void Encode(int32_t N, int32_t A[], int32_t B[]){
for(int x=0;x<N;x++){
adj[A[x]].push_back(B[x]);
adj[B[x]].push_back(A[x]);
}
dfs(0,-1);
for(int x=0;x<N;x++){
Code(x,in[x]*250001+out[x]);
}
}
#include "Device.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
//#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,int>pi2;
//mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());
void InitDevice(){
}
int32_t Answer(long long S, long long T){
int l=S/250001;
int r=S%250001;
int l2=T/250001;
int r2=T%250001;
if(l<=l2&&r>=l2){
return 1;
}
else if(l2<=l&&r2>=l){
return 0;
}
else return 2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |