Submission #427300

# Submission time Handle Problem Language Result Execution time Memory
427300 2021-06-14T14:06:53 Z kai824 City (JOI17_city) C++17
22 / 100
661 ms 47268 KB
#include "Encoder.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

vector<int> adjl[250005];
ll pre[250005],sub[250005],nex;

void dfs(int node,int p=-1){
	pre[node]=nex++;
	for(int x:adjl[node]){
		if(x==p)continue;
		dfs(x,node);
	}
	sub[node]=nex-1;
	// cout<<node<<' '<<pre[node]<<' '<<sub[node]<<'\n';
	Code(node,pre[node]*250000+sub[node]);
}

void Encode(int n, int a[], int b[]){
	for(int i=0;i+1<n;i++){
		adjl[a[i]].push_back(b[i]);
		adjl[b[i]].push_back(a[i]);
	}
	dfs(0);
	//Code(i, 0LL): node, label...
}
#include "Device.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

void InitDevice(){}

int Answer(long long s, long long t){
	int p1,p2,s1,s2;
	p1=s/250000;
	s1=s%250000;
	p2=t/250000;
	s2=t%250000;
	if(p1<p2 && p2<=s1)return 1;
	if(p2<p1 && p1<=s2)return 0;
	return 2;
}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 6408 KB Output is correct
2 Correct 4 ms 6408 KB Output is correct
3 Correct 4 ms 6408 KB Output is correct
4 Correct 6 ms 6400 KB Output is correct
5 Correct 4 ms 6408 KB Output is correct
6 Correct 5 ms 6516 KB Output is correct
7 Correct 4 ms 6400 KB Output is correct
8 Correct 4 ms 6404 KB Output is correct
9 Correct 5 ms 6440 KB Output is correct
10 Correct 5 ms 6376 KB Output is correct
11 Correct 5 ms 6400 KB Output is correct
12 Correct 4 ms 6408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 205 ms 15092 KB Output is correct - L = 174750699
2 Correct 204 ms 15012 KB Output is correct - L = 174500698
3 Correct 205 ms 15140 KB Output is correct - L = 174750699
4 Correct 211 ms 15040 KB Output is correct - L = 174750699
5 Partially correct 560 ms 43052 KB Output is partially correct - L = 62499999999
6 Partially correct 520 ms 46456 KB Output is partially correct - L = 62499999999
7 Partially correct 552 ms 46432 KB Output is partially correct - L = 62499999999
8 Partially correct 531 ms 46144 KB Output is partially correct - L = 62499999999
9 Partially correct 522 ms 47180 KB Output is partially correct - L = 62499999999
10 Partially correct 468 ms 47180 KB Output is partially correct - L = 62499999999
11 Partially correct 434 ms 47268 KB Output is partially correct - L = 62499999999
12 Partially correct 431 ms 46888 KB Output is partially correct - L = 62499999999
13 Partially correct 483 ms 46444 KB Output is partially correct - L = 62499999999
14 Partially correct 505 ms 46068 KB Output is partially correct - L = 62499999999
15 Correct 194 ms 20332 KB Output is correct - L = 174750699
16 Correct 228 ms 20336 KB Output is correct - L = 174750699
17 Correct 215 ms 20352 KB Output is correct - L = 174750699
18 Partially correct 491 ms 45196 KB Output is partially correct - L = 62499999999
19 Partially correct 498 ms 45600 KB Output is partially correct - L = 62499999999
20 Partially correct 525 ms 45580 KB Output is partially correct - L = 62499999999
21 Partially correct 513 ms 45520 KB Output is partially correct - L = 62499999999
22 Partially correct 589 ms 45452 KB Output is partially correct - L = 62499999999
23 Partially correct 589 ms 45492 KB Output is partially correct - L = 62499999999
24 Partially correct 621 ms 45452 KB Output is partially correct - L = 62499999999
25 Partially correct 655 ms 45236 KB Output is partially correct - L = 62499999999
26 Partially correct 661 ms 45352 KB Output is partially correct - L = 62499999999
27 Partially correct 585 ms 45304 KB Output is partially correct - L = 62499999999