QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#86918#1212. NavigationMaraschinoCompile Error//C++17864b2023-03-11 14:48:412023-03-11 14:49:22

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-11 14:49:22]
  • 评测
  • [2023-03-11 14:48:41]
  • 提交

Anna

#include <bits/stdc++.h>
#include "Annalib.h"

#define eb emplace_back
static const int N = 1'000'005;

int col[N];
std::vector<int> e[N];

void dfs(int x, int fa)
{
    for (int y : e[x])
        if (y != fa)
        {
            col[y] = col[x] ^ (y >= x);
            dfs(y, x);
        }
}
void Anna(int K, int N, int T, int A[], int B[])
{
    for (int i = 0; i < N - 1; ++i)
    {
        e[A[i]].eb(B[i]);
        e[B[i]].eb(A[i]);
    }
    dfs(T, -1);
    for (int i = 1; i <= N : ++i)
        Flag(i, col[i]);
    return void();
}

Bruno

#include <bits/stdc++.h>
#include "Brunolib.h"

void Bruno(int K, int S, int F, int L, int P[], int Q[])
{
    for (int i = 0; i < L; ++i)
    {
        if ((S <= P[i]) == (F == Q[i]))
        {
            Answer(P[i]);
            return void();
        }
    }
    Answer(S);
}

Details

Anna.code: In function ‘void Anna(int, int, int, int*, int*)’:
Anna.code:27:21: warning: range-based ‘for’ loops with initializer only available with ‘-std=c++20’ or ‘-std=gnu++20’
   27 |     for (int i = 1; i <= N : ++i)
      |                     ^
Anna.code:27:27: error: expected ‘;’ before ‘:’ token
   27 |     for (int i = 1; i <= N : ++i)
      |                           ^~
      |                           ;
Anna.code:29:5: error: expected primary-expression before ‘return’
   29 |     return void();
      |     ^~~~~~
Anna.code:28:25: error: expected ‘;’ before ‘return’
   28 |         Flag(i, col[i]);
      |                         ^
      |                         ;
   29 |     return void();
      |     ~~~~~~               
Anna.code:29:5: error: expected primary-expression before ‘return’
   29 |     return void();
      |     ^~~~~~
Anna.code:28:25: error: expected ‘)’ before ‘return’
   28 |         Flag(i, col[i]);
      |                         ^
      |                         )
   29 |     return void();
      |     ~~~~~~               
Anna.code:27:9: note: to match this ‘(’
   27 |     for (int i = 1; i <= N : ++i)
      |         ^
grader.cpp: In function ‘int main(int, char**)’:
grader.cpp:144:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  144 |         scanf("%d%d%d%d", &K, &S, &F, &L);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
grader.cpp:146:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  146 |                 scanf("%d", &P_[i]);
      |                 ~~~~~^~~~~~~~~~~~~~
grader.cpp:150:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  150 |                 scanf("%d", &Q_[i]);
      |                 ~~~~~^~~~~~~~~~~~~~