Submission #1008909

#TimeUsernameProblemLanguageResultExecution timeMemory
1008909emptypringlescanCity (JOI17_city)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#include "Encoder.h"
vector<int> adj[250005];
long long pre[250005],pos[250005];
int cur=0;
void dfs(int x, int p){
	cur++;
	pre[x]=cur;
	for(int i:adj[x]){
		if(i!=p) dfs(i,x);
	}
	pos[x]=cur;
}
void Encode(int n, int u[], int v[]){
	for(int i=0; i<n-1; i++){
		adj[u[i]].push_back(v[i]);
		adj[v[i]].push_back(u[i]);
	}
	dfs(0);
	for(int i=0; i<n; i++){
		Code(i,pre[i]<<18ll|pos[i]);
	}
}
#include <bits/stdc++.h>
using namespace std;
#include "Device.h"
void InitDevice(){
	
}
int Answer(long long a, long long B){
	long long prea=a>>18ll,posa=a^(prea<<18ll);
	long long preb=b>>18ll,posb=b^(preb<<18ll);
	if(preb<=prea&&posa<=posb) return 0;
	else if(prea<=preb&&posb<=posa) return 1;
	return 2;
}

Compilation message (stderr)

Encoder.cpp: In function 'void Encode(int, int*, int*)':
Encoder.cpp:20:7: error: too few arguments to function 'void dfs(int, int)'
   20 |  dfs(0);
      |       ^
Encoder.cpp:7:6: note: declared here
    7 | void dfs(int x, int p){
      |      ^~~

Device.cpp: In function 'int Answer(long long int, long long int)':
Device.cpp:9:17: error: 'b' was not declared in this scope
    9 |  long long preb=b>>18ll,posb=b^(preb<<18ll);
      |                 ^
Device.cpp:10:23: error: 'posb' was not declared in this scope; did you mean 'posa'?
   10 |  if(preb<=prea&&posa<=posb) return 0;
      |                       ^~~~
      |                       posa