Submission #933611

# Submission time Handle Problem Language Result Execution time Memory
933611 2024-02-26T01:23:17 Z vjudge1 Speedrun (RMI21_speedrun) C++14
0 / 100
1 ms 484 KB
#include <bits/stdc++.h>
#include <speedrun.h>
using namespace std;

void assignHints (int subtask , int N, int A[], int B[])
{
	setHintLen(1);
	vector<int>adj(N+1);
	for (int i = 0; i < N; i++)
	{
		adj[A[i]]++;
		adj[B[i]]++;
	}
	for (int i = 0; i < N+1; i++)
	{
		if (adj[A[i]] == 1)
			continue;
		setHint(i, 0, 1);
	}
}
void speedrun(int subtask , int N, int start )
{
	bool yo = getHint(0);
	int jefe;
	if (!yo)
	{
		for (int i = 1; i < N+1; i++)
		{
			if (i == start) continue;
			if (!goTo(i)) continue;
			jefe = i; break;
		}
	}
	else jefe = start;
	for (int i = 1; i <= N; i++)
	{
		if (i == jefe) continue;
		goTo(i);
		goTo(jefe);
	}
}

Compilation message

speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:39:7: warning: 'jefe' may be used uninitialized in this function [-Wmaybe-uninitialized]
   39 |   goTo(jefe);
      |   ~~~~^~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 480 KB Invalid node index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 480 KB Invalid node index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 480 KB Invalid node index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 476 KB Invalid node index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 484 KB Invalid node index for setHint
2 Halted 0 ms 0 KB -