Submission #1031077

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

int Answer(long long S, long long T)
{
//	cout << nms.size() << " " << (S/(3*N)) << endl;
//	cout << nms.size() << " " << (T/(3*N)) << endl;
	long long fs = S/(3*N);
	long long ss = fs+nms[S%(3*N)]-1;
	long long ft = T/(3*N);
	long long st = ft+nms[T%(3*N)]-1;
//	cout << fs << " " << ss << endl;
//	cout << ft << " " << st << endl;
//	cout << endl;
	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 = 250'010;
vector<int> nms;
void InitDevice()
{
	long double d = 1.05;
	long double val = d;
	while(val <= 3*N) {
		if(!nms.size() or nms.back()!=(int)val)
			nms.push_back(val);
		val*=d;
	}
}

int Answer(long long S, long long T)
{
//	cout << nms.size() << " " << (S/(3*N)) << endl;
//	cout << nms.size() << " " << (T/(3*N)) << endl;
	int fs = S/(3*N);
	int ss = fs+nms[S%(3*N)]-1;
	int ft = T/(3*N);
	int st = ft+nms[T%(3*N)]-1;
//	cout << fs << " " << ss << endl;
//	cout << ft << " " << st << endl;
//	cout << endl;
	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/ccx0axhU.o: in function `main':
grader_encoder.cpp:(.text.startup+0xd1): undefined reference to `Encode(int, int*, int*)'
collect2: error: ld returned 1 exit status