Submission #746870

# Submission time Handle Problem Language Result Execution time Memory
746870 2023-05-23T07:51:02 Z tutis Game (APIO22_game) C++17
Compilation error
0 ms 0 KB
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
const int N = 300000;
int K;

vector<int>adj[2][N];
int mx[2][N];
void init(int n, int k) {
	K = k;
	for (int i = 0; i < n; i++)
		mx[0][i] = -k;
	for (int i = 0; i < k; i++)
		mx[0][i] = -(i + 1);
	for (int i = 0; i < k; i++)
		mx[1][i] = i;
	for (int i = k; i < n; i++)
		mx[1][i] = -1;
}

int add_teleporter(int u, int v) {
	int x = min(v, -mx[0][v]);
	int y = mx[1][u];
	if (y >= x)
		return 1;
	int V[2] = { -x, y};
	for (int t : {1, 0})
	{
		function<void(int)>dfs = [&](int i) {
			mx[t][i] = V[t];
			for (int j : adj[t][i])
				if (V[t] > mx[t][j])
					dfs(j);
		};
		if (V[t] > mx[t][v])
			dfs(v);
		swap(u, v);
	}
	return 0;
}
int main() {}

Compilation message

/usr/bin/ld: /tmp/ccFLAEbg.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccuTtbDc.o:game.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status