Submission #736706

# Submission time Handle Problem Language Result Execution time Memory
736706 2023-05-06T06:47:36 Z flappybird Speedrun (RMI21_speedrun) C++17
0 / 100
1 ms 384 KB
#include "speedrun.h"
#include <bits/stdc++.h>
using namespace std;
#define MAX 1010

namespace srun {
	int N;
	int ord[MAX];
	void mark(int v, int x, int bias) { for (int i = 0; i < 10; i++) setHint(v, i + bias, (x >> i) & 1); }
	int get(int bias) { int ans = 0; for (int i = 0; i < 10; i++) if (getHint(i + bias)) ans |= (1 << i); return ans; }
	vector<int> adj[MAX];
	int pv = 0;
	void dfs(int x, int p = 0) {
		if (pv) mark(pv, x, 1);
		pv = x;
		if (p) mark(x, p, 11);
		for (auto v : adj[x]) if (v != p) dfs(v, x);
	}
}

using namespace srun;

void assignHints(int subtask, int _N, int A[], int B[]) {
	setHintLen(10);
	N = _N;
	int i;
	for (i = 1; i < N; i++) {
		adj[A[i]].push_back(B[i]);
		adj[B[i]].push_back(A[i]);
	}
	dfs(1);
}

void speedrun(int subtask, int N, int start) {
	int v = start;
	while (1) {
		int res = get(11);
		if (res) goTo(v = res);
		else break;
	}
	vector<int> st(1, 1);
	while (1) {
		int nxt = get(1);
		if (!nxt) return;
		while (!goTo(nxt)) {
			st.pop_back();
			goTo(st.back());
		}
		st.push_back(nxt);
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 372 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Invalid bit index for setHint
2 Halted 0 ms 0 KB -