Submission #1031100

#TimeUsernameProblemLanguageResultExecution timeMemory
1031100s_treeCity (JOI17_city)C++17
Compilation error
0 ms0 KiB
#include "Device.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 650'010;
vector<long long> nms;
void InitDevice()
{
	long double d = 1.05;
	long double val = d;
	while(val <= N) {
		if(!nms.size() or nms.back()!=(int)val)
			nms.push_back(val);
		val*=d;
	}
}

int Answer(long long S, long long T)
{
	long long fs = S/(N);
	long long ss = fs-1+nms[S%(nms.size())];
	long long ft = T/(N);
	long long st = ft-1+nms[T%(nms.size())];
	if(fs <= ft and st <= ss)return 1;
	if(ft <= fs and ss <= st)return 0;
	return 2;
}
#include "Device.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 700'010;
vector<long long> nms;
void InitDevice()
{
	long double d = 1.05;
	long double val = d;
	while(val <= N) {
		if(!nms.size() or nms.back()!=(int)val)
			nms.push_back(val);
		val*=d;
	}
}

int Answer(long long S, long long T)
{
	long long fs = S/(N);
	long long ss = fs-1+nms[S%(N)];
	long long ft = T/(N);
	long long st = ft-1+nms[T%(N)];
	if(fs <= ft and st <= ss)return 1;
	if(ft <= fs and ss <= st)return 0;
	return 2;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccllHhg6.o: in function `main':
grader_encoder.cpp:(.text.startup+0xd1): undefined reference to `Encode(int, int*, int*)'
collect2: error: ld returned 1 exit status