Submission #982760

# Submission time Handle Problem Language Result Execution time Memory
982760 2024-05-14T17:27:54 Z vjudge1 Game (APIO22_game) C++17
0 / 100
1 ms 344 KB
#include "game.h"

#include <bits/stdc++.h>
#define all(x) begin((x)), end((x))
using ll = long long;
using namespace std;

vector<vector<int>> g(1001);
ll                  planets, specials;

void init(int n, int k) {
	planets = n, specials = k;
	for (int i = 0; i < k - 1; i++) g[i].push_back(i + 1);
}

int add_teleporter(int u, int v) {
	g[u].push_back(v);

	vector<bool>       vis(1001);
	priority_queue<ll> q;
	q.push(0);

	while (q.size()) {
		ll curr = q.top();
		q.pop();
		cout << curr << endl;
		if (vis[curr] && curr < specials) return true;
		else if (vis[curr])
			continue;

		vis[curr] = true;

		for (const int& nei : g[curr]) q.push(nei);
	}
	return false;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 344 KB Wrong Answer[1]
3 Halted 0 ms 0 KB -