QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#359761#408. Dungeon 2antekpuszCompile Error//C++111.3kb2024-03-20 20:41:142024-03-20 20:41:15

Judging History

你现在查看的是最新测评结果

  • [2024-03-20 20:41:15]
  • 评测
  • [2024-03-20 20:41:14]
  • 提交

answer

#include <bits/stdc++.h>
#include dungeon2.h
using namespace std;

vector<vector<int>> g (60, vector<int>());
vector<int> o (60, 0);
int poz = 2;
int ilew = 1;

void dfs (int v) {
    int x = NumberOfRoads();
    for (int i = 1; i < x+1; i++) {
        Move(i, v);
        int kp = LastRoad();
        if (o[Color()] == i) {
            continue;
        }
        if (Color() == 1) {
            ilew++;
            int u = ilew+1;
            o[u] = v;
            dfs(u);
            g[v].push_back(u);
            g[u].push_back(v);
        }
        else {
            g[v].push_back(Color());
            g[Color()].push_back(v);
        }
        Move(kp, Color());
    }
}

void Inspect(int R) {
    dfs(2);
    vector<int> w (60, 0);
    for (int i = 2; i < ilew+2; i++) {
        queue<int> q;
        vector<int> dl (ilew+2, 10000000);
        q.push(i);
        dl[i] = 0;
        while (!q.empty()) {
            int v = q.front();
            q.pop();
            for (int u : g[v]) {
                if (dl[u] != 10000000) {
                    dl[u] = dl[v]+1;
                    w[dl[u]]++;
                    q.push(u);
                }
            }
        }
    }
    for (int i = 1; i < R+1; i++) {
        Answer(i, w[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:2:10: error: #include expects "FILENAME" or <FILENAME>
    2 | #include dungeon2.h
      |          ^~~~~~~~
answer.code: In function ‘void dfs(int)’:
answer.code:11:13: error: ‘NumberOfRoads’ was not declared in this scope
   11 |     int x = NumberOfRoads();
      |             ^~~~~~~~~~~~~
answer.code:13:9: error: ‘Move’ was not declared in this scope; did you mean ‘remove’?
   13 |         Move(i, v);
      |         ^~~~
      |         remove
answer.code:14:18: error: ‘LastRoad’ was not declared in this scope
   14 |         int kp = LastRoad();
      |                  ^~~~~~~~
answer.code:15:15: error: ‘Color’ was not declared in this scope
   15 |         if (o[Color()] == i) {
      |               ^~~~~
answer.code:18:13: error: ‘Color’ was not declared in this scope
   18 |         if (Color() == 1) {
      |             ^~~~~
answer.code:30:18: error: ‘Color’ was not declared in this scope
   30 |         Move(kp, Color());
      |                  ^~~~~
answer.code: In function ‘void Inspect(int)’:
answer.code:55:9: error: ‘Answer’ was not declared in this scope
   55 |         Answer(i, w[i]/2);
      |         ^~~~~~