Submission #61098

# Submission time Handle Problem Language Result Execution time Memory
61098 2018-07-25T08:06:28 Z 김세빈(#1761) City (JOI17_city) C++11
22 / 100
534 ms 52944 KB
#include "Encoder.h"

#include <bits/stdc++.h>

using namespace std;

vector <int> V[252525];
int cnt;

int dfs(int p, int r)
{
	int l = ++cnt;
	
	for(int t: V[p]){
		if(t != r) dfs(t, p);
	}
	
	Code(p, ((long long)l << 18) + cnt);
}

void Encode(int N, int A[], int B[])
{
	int i;
	
	for(i=0; i<N-1; i++){
		V[A[i]].push_back(B[i]);
		V[B[i]].push_back(A[i]);
	}
	
	dfs(0, 0);
}
#include "Device.h"

void InitDevice() {}

int Answer(long long S, long long T)
{
	int l1 = S >> 18, r1 = S & (1 << 18) - 1;
	int l2 = T >> 18, r2 = T & (1 << 18) - 1;
	
	if(l1 <= l2 && r2 <= r1) return 1;
	if(l2 <= l1 && r1 <= r2) return 0;
	
	return 2;
}

Compilation message

Encoder.cpp: In function 'int dfs(int, int)':
Encoder.cpp:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^

Device.cpp: In function 'int Answer(long long int, long long int)':
Device.cpp:7:39: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
  int l1 = S >> 18, r1 = S & (1 << 18) - 1;
                             ~~~~~~~~~~^~~
Device.cpp:8:39: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
  int l2 = T >> 18, r2 = T & (1 << 18) - 1;
                             ~~~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 8 ms 12600 KB Output is correct
2 Correct 8 ms 12544 KB Output is correct
3 Correct 8 ms 12544 KB Output is correct
4 Correct 8 ms 12544 KB Output is correct
5 Correct 9 ms 12544 KB Output is correct
6 Correct 9 ms 12544 KB Output is correct
7 Correct 8 ms 12544 KB Output is correct
8 Correct 8 ms 12544 KB Output is correct
9 Correct 7 ms 12416 KB Output is correct
10 Correct 8 ms 12544 KB Output is correct
11 Correct 8 ms 12544 KB Output is correct
12 Correct 8 ms 12544 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 170 ms 19544 KB Output is correct - L = 183501500
2 Correct 169 ms 19616 KB Output is correct - L = 183239355
3 Correct 168 ms 19552 KB Output is correct - L = 183501500
4 Correct 165 ms 19448 KB Output is correct - L = 183501500
5 Partially correct 502 ms 51480 KB Output is partially correct - L = 65536250000
6 Partially correct 497 ms 51552 KB Output is partially correct - L = 65536250000
7 Partially correct 463 ms 51496 KB Output is partially correct - L = 65536250000
8 Partially correct 475 ms 50984 KB Output is partially correct - L = 65536250000
9 Partially correct 407 ms 52688 KB Output is partially correct - L = 65536250000
10 Partially correct 400 ms 52944 KB Output is partially correct - L = 65536250000
11 Partially correct 405 ms 52928 KB Output is partially correct - L = 65536250000
12 Partially correct 405 ms 52840 KB Output is partially correct - L = 65536250000
13 Partially correct 451 ms 52144 KB Output is partially correct - L = 65536250000
14 Partially correct 470 ms 51800 KB Output is partially correct - L = 65536250000
15 Correct 170 ms 19440 KB Output is correct - L = 183501500
16 Correct 170 ms 19704 KB Output is correct - L = 183501500
17 Correct 170 ms 19864 KB Output is correct - L = 183501500
18 Partially correct 474 ms 51976 KB Output is partially correct - L = 65536250000
19 Partially correct 451 ms 52136 KB Output is partially correct - L = 65536250000
20 Partially correct 454 ms 51904 KB Output is partially correct - L = 65536250000
21 Partially correct 457 ms 52016 KB Output is partially correct - L = 65536250000
22 Partially correct 479 ms 51760 KB Output is partially correct - L = 65536250000
23 Partially correct 534 ms 51720 KB Output is partially correct - L = 65536250000
24 Partially correct 475 ms 51616 KB Output is partially correct - L = 65536250000
25 Partially correct 478 ms 51552 KB Output is partially correct - L = 65536250000
26 Partially correct 490 ms 51376 KB Output is partially correct - L = 65536250000
27 Partially correct 519 ms 51576 KB Output is partially correct - L = 65536250000