Submission #49419

# Submission time Handle Problem Language Result Execution time Memory
49419 2018-05-28T16:02:19 Z SpaimaCarpatilor City (JOI17_city) C++17
Compilation error
0 ms 0 KB
#include "Device.h"
#include<bits/stdc++.h>
using namespace std;

void InitDevice()
{

}

int Answer (long long S, long long T)
{
    long long lS = (S >> 18), rS = S & ((1 << 18LL) - 1);
    long long lT = (T >> 18), rT = T & ((1 << 18LL) - 1);
    if (lT <= lS && rS <= rT) return 0;
    if (lS <= lT && rT <= rS) return 1;
	return 2;
}
#include "Encoder.h"
#include<bits/stdc++.h>
using namespace std;

int nr = 0, l[250009], r[250009];
vector < int > v[250009];

void dfs (int nod, int tata)
{
    l[nod] = ++nr;
    for (auto it : v[nod])
        if (it != tata)
            dfs (it, nod);
    r[nod] = nr;
}

void Encode (int N, int A[], int B[])
{
    for (int i=0; i<N; i++)
        v[A[i]].push_back (B[i]),
        v[B[i]].push_back (A[i]);
    dfs (0, -1);
	for (int i=0; i<N; i++)
    {
		Code(i, ((1LL << 18) * l[i]) | ((long long) r[i]));
		//printf ("%d: %lld\n", ((1LL << 18) * l[i]) | ((long long) r[i]));
    }
}

Compilation message

/tmp/ccR9dtAf.o: In function `main':
grader_encoder.cpp:(.text.startup+0xb7): undefined reference to `Encode(int, int*, int*)'
collect2: error: ld returned 1 exit status

/tmp/ccRH3Npb.o: In function `main':
grader_device.cpp:(.text.startup+0xe3): undefined reference to `InitDevice()'
grader_device.cpp:(.text.startup+0x16a): undefined reference to `Answer(long long, long long)'
collect2: error: ld returned 1 exit status