Submission #746841

# Submission time Handle Problem Language Result Execution time Memory
746841 2023-05-23T07:08:50 Z tutis Game (APIO22_game) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
const int N = 300000;
int K;

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

int add_teleporter(int u, int v) {
	adj[u].push_back(v);
	adj_[v].push_back(u);
	int x = min(v, mn[v]);
	int ret = 0;
	function<void(int)>dfs = [&](int i) {
		if (x >= mn[i])
			return;
		mn[i] = x;
		if (i < K && x <= i) {
			ret = 1;
		}
		for (int j : adj[i]) {
			dfs(j);
		}
	};
	dfs(u);
	return ret;
}

int main()
{
	init(4, 2);
	cout << add_teleporter(1, 1) << endl;
}

Compilation message

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