QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#34668#4251. Gamelunchbox#0 1ms4648kbC++17610b2022-06-12 04:28:522024-05-26 00:51:45

Judging History

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

  • [2024-05-26 00:51:45]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:4648kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-06-12 04:28:52]
  • 提交

answer

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

const int N = 30000;

std::vector<int> ej[N];
int ww[N], tt[N], n;

void init(int n_, int k) {
  n = n_;
  for (int i = 0; i < k - 1; i++)
    ej[i].push_back(i + 1), ww[i + 1]++;
}

int add_teleporter(int u, int v) {
  static int qu[N];
  int head = 0, cnt = 0;

  for (int i = 0; i < n; i++)
    if ((tt[i] = ww[i]) == 0)
      qu[head + cnt++] = i;

  while (cnt) {
    int i = qu[head++];
    cnt--;

    for (int j : ej[i])
      if (--tt[j] == 0)
        qu[head + cnt++] = j;
  }
  return head != n;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 4648kb

input:

1 1
1
893123 893123
-1

output:

1

result:

wrong answer Wrong Answer [1]

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #1:

0%