QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#21216 | #2810. Speedrun | Qingyu | 0 ✓ | 0ms | 0kb | C++20 | 1.6kb | 2022-03-03 17:24:16 | 2024-05-20 18:37:33 |
Judging History
你现在查看的是测评时间为 2024-05-20 18:37:33 的历史记录
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2022-03-03 17:24:16]
- 提交
speedrun
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> void check_min(T &a, const T &b){ a = (a < b) ? a : b; }
template<class T> void check_max(T &a, const T &b){ a = (a > b) ? a : b; }
#define all(x) (x).begin(), (x).end()
void setHintLen (int l);
void setHint(int i, int j, bool b);
int getLength ();
bool getHint(int j);
bool goTo(int x);
const int N = 1000 + 3;
vector<int> adj[N], order;
int p[N], n;
void setNumber(int i, bool second, int num){
for(int j = 0; j < 10; ++j)
setHint(i, 10 * second + j + 1, (num >> j) & 1);
}
void dfs(int u, int par){
order.push_back(u);
p[u] = par;
for(int to: adj[u]){
if(to == par) continue;
dfs(to, u);
}
}
void assignHints(int subtask, int _n, int a[], int b[]){
setHintLen(20);
n = _n;
for(int i = 1; i < n; ++i){
adj[a[i]].push_back(b[i]);
adj[b[i]].push_back(a[i]);
}
dfs(1, 1);
for(int i = 0; i < n; ++i){
int x = order[i];
setNumber(x, 0, p[x]);
if(i == n - 1) setNumber(x, 1, x);
else setNumber(x, 1, order[i + 1]);
}
}
int getNumber(bool second){
int result = 0;
for(int j = 0; j < 10; ++j)
result += ((int)getHint(10 * second + j + 1)) << j;
return result;
}
void speedrun(int subtask, int _n, int start){
n = _n;
while(start != 1)
goTo(start = getNumber(0));
while(getNumber(1) != start){
int nxt = getNumber(1);
while(!goTo(nxt))
goTo(start = getNumber(0));
start = nxt;
}
}
詳細信息
Subtask #1:
score: 0
Interactor1 Dangerous Syscalls
Test #1:
score: 0
Interactor1 Dangerous Syscalls
input:
output:
input:
output:
result:
Subtask #2:
score: 0
Interactor1 Dangerous Syscalls
Test #5:
score: 0
Interactor1 Dangerous Syscalls
input:
output:
input:
output:
result:
Subtask #3:
score: 0
Interactor1 Dangerous Syscalls
Test #7:
score: 0
Interactor1 Dangerous Syscalls
input:
output:
input:
output:
result:
Subtask #4:
score: 0
Interactor1 Dangerous Syscalls
Test #10:
score: 0
Interactor1 Dangerous Syscalls
input:
output:
input:
output:
result:
Subtask #5:
score: 0
Interactor1 Dangerous Syscalls
Test #16:
score: 0
Interactor1 Dangerous Syscalls