QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#359752 | #408. Dungeon 2 | user1234 | Compile Error | / | / | C++14 | 1.3kb | 2024-03-20 20:37:41 | 2024-03-20 20:37:41 |
Judging History
answer
#include <bits/stdc++.h>
#include "dungeon2.h"
using namespace std;
int aktualny = 2;
vector <short> sasiedzi[204];
//int numer_ojca[204];
short n, m;
int odleglosci[201];
int zaglebienie[203];
void dfs() {
int k = NumberOfRoads();
int kolor = aktualny;
int hoplita;
aktualny++;
for (int i = 1; i <= k; i++) {
Move(i, kolor);
int jak_wracamy = LastRoad();
if (Color() == 1) {
hoplita = aktualny;
sasiedzi[hoplita].push_back(aktualny);
sasiedzi[aktualny].push_back(hoplita);
dfs();
}
else hoplita = Color();
Move(jak_wracamy, hoplita);
}
}
void bfs(int x) {
if (!sasiedzi[x].size()) return;
fill(zaglebienie + 2, zaglebienie + 203, -1);
zaglebienie[x] = 0;
queue <int> kolejka;
kolejka.push(x);
while (!kolejka.empty()) {
int v = kolejka.front();
kolejka.pop();
for (int sasiad : sasiedzi[v]) {
if (zaglebienie[sasiad] != -1) continue;
zaglebienie[sasiad] = zaglebienie[x] + 1;
odleglosci[zaglebienie[sasiad]]++;
kolejka.push(sasiad);
}
}
}
void Inspect(int R) {
dfs();
for (int i = 2; i <= 201) bfs(i);
for (int i = 1; i <= R; i++) Answer(i, odleglosci[i] / 2);
}
詳細信息
implementer.cpp: In function ‘int main()’: implementer.cpp:94:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 94 | scanf("%d", &(n_roads[i])); | ~~~~~^~~~~~~~~~~~~~~~~~~~~ implementer.cpp:98:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 98 | scanf("%d", &(road[i][j])); | ~~~~~^~~~~~~~~~~~~~~~~~~~~ implementer.cpp:105:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 105 | scanf("%d", &(expected_answer[i])); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer.code: In function ‘void Inspect(int)’: answer.code:48:29: error: expected ‘;’ before ‘)’ token 48 | for (int i = 2; i <= 201) bfs(i); | ^ | ;