QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#359651 | #408. Dungeon 2 | bonkar | 0 | 0ms | 0kb | C++14 | 1.4kb | 2024-03-20 19:44:29 | 2024-03-20 19:46:15 |
answer
#include "dungeon2.h"
#include <bits/stdc++.h>
using namespace std;
int n = 1;
constexpr int MAXN = 202;
vector<int> dro[MAXN];
void DFS(int pop, int psc){
int i = Color();
if(i==1){
i = ++n;
dro[i].resize(NumberOfRoads()+1);
}
cerr << i << ' ' << dro[i].size() << "\n";
if(pop != -1){
dro[pop][psc] = i;
dro[i][LastRoad()] = pop;
}
//Check if we have free road
for(int j = 1; j < dro[i].size(); j++){
if(dro[i][j] == 0){
Move(j, i);
DFS(i, j);
}
}
//If we don't : don't worry we`ll get ere
for(int j = 1; j < dro[i].size(); j++){
if(dro[i][j]==pop){
Move(j, i);
break;
}
}
}
int ans[MAXN];
int odl[MAXN];
int BFS(int i){
for(int i = 1; i <= n; i++) odl[i]=0;
queue<int> q;
q.push(i);
odl[i]=1;
while(q.size()){
int i = q.front();
q.pop();
ans[odl[i]-1]++;
for(int j = 1; j < dro[i].size(); j++){
int v = dro[i][j];
if(odl[v]==0){
odl[v]=odl[i]+1;
q.push(v);
}
}
}
}
void Inspect(int R)
{
int i;
// cerr << "Last : " << LastRoad();
DFS(-1, -1);
// cerr << "Wypisańsko:\n";
for(int i = 1; i <= n; i++){
// cerr << i << ' '<< " : ";
for(int j : dro[i]) cerr << j << ' ';
// cerr << '\n';
}
for(int i = 1; i <= n; i++){
BFS(i);
}
for(int i = 1; i <= R; i++){
Answer(i, ans[i]/2);
// cerr << i << ' ' << ans[i] << ' ' << ans[i]/2 << '\n';
}
// for (i = 1; i <= R; ++i) {
// Answer(i, 0);
// }
}
详细
Subtask #1:
score: 0
Runtime Error
Test #1:
score: 0
Runtime Error
input:
10 100 50 7 5 7 10 4 6 2 3 2 1 5 3 1 10 7 2 10 1 3 1 9 2 2 1 7 5 9 6 8 3 1 1 7 2 5 7 3 1 4 3 15 24 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
Unauthorized output
result:
Subtask #2:
score: 0
Runtime Error
Test #16:
score: 0
Runtime Error
input:
10 3 50 4 7 4 10 5 2 8 6 1 10 2 1 9 3 1 7 10 2 7 2 5 6 1 5 8 9 3 7 9 2 4 10 8 7 4 4 1 9 5 3 15 19 9 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
output:
Wrong Answer [6]
result:
Subtask #3:
score: 0
Runtime Error
Test #31:
score: 0
Runtime Error
input:
200 3 200 6 149 79 143 164 179 68 4 44 52 144 113 1 84 3 31 188 166 1 109 4 154 192 125 147 1 198 4 103 27 192 95 3 33 166 179 1 125 3 31 61 150 3 168 152 161 2 67 64 1 136 2 150 17 1 192 2 15 142 2 56 122 1 35 2 97 200 2 129 22 4 72 134 31 21 2 53 82 4 195 181 104 146 1 78 1 88 3 8 78 127 4 152 200...
output:
Wrong Answer [6]