Submission #802564

# Submission time Handle Problem Language Result Execution time Memory
802564 2023-08-02T12:46:23 Z Um_nik Stray Cat (JOI20_stray) C++17
15 / 100
48 ms 16848 KB
#include "Anthony.h"
#include <vector>
#include <cassert>
using namespace std;

namespace {

}  // namespace

vector<int> Mark(int N, int M, int A, int B,
                      vector<int> U, vector<int> V) {
  vector<int> X(M);
  if (A >= 3) {
    vector<vector<int>> g(N, vector<int>());
    for (int i = 0; i < M; i++) {
      int u = U[i], v = V[i];
      g[u].push_back(v);
      g[v].push_back(u);
    }
    vector<int> dist(N, N);
    dist[0] = 0;
    vector<int> q;
    q.push_back(0);
    for (int i = 0; i < (int)q.size(); i++) {
      int v = q[i];
      for (int u : g[v]) if (dist[u] == N) {
        dist[u] = dist[v] + 1;
        q.push_back(u);
      }
    }
    assert((int)q.size() == N);
    for (int i = 0; i < M; i++)
      X[i] = min(dist[U[i]], dist[V[i]]) % 3;
  } else {
    assert(false);
  }
  return X;
}
#include "Catherine.h"
#include <vector>
#include <cassert>
using namespace std;

namespace {

int A, B;

}  // namespace

void Init(int A, int B) {
  ::A = A;
}

int Move(std::vector<int> y) {
  if (A > 2) {
    int c = 0;
    while(c < 3) {
      if (y[c] > 0 && y[(c + 2) % 3] == 0) break;
      c++;
    }
    assert(c < 3);
    return c;
  } else {
    assert(false);
  }
}

Compilation message

Catherine.cpp:8:8: warning: '{anonymous}::B' defined but not used [-Wunused-variable]
    8 | int A, B;
      |        ^
# Verdict Execution time Memory Grader output
1 Correct 31 ms 15656 KB Output is correct
2 Correct 1 ms 508 KB Output is correct
3 Correct 24 ms 14892 KB Output is correct
4 Correct 43 ms 16788 KB Output is correct
5 Correct 34 ms 16848 KB Output is correct
6 Correct 32 ms 15440 KB Output is correct
7 Correct 27 ms 15504 KB Output is correct
8 Correct 33 ms 16172 KB Output is correct
9 Correct 33 ms 16152 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 15656 KB Output is correct
2 Correct 1 ms 508 KB Output is correct
3 Correct 24 ms 14892 KB Output is correct
4 Correct 43 ms 16788 KB Output is correct
5 Correct 34 ms 16848 KB Output is correct
6 Correct 32 ms 15440 KB Output is correct
7 Correct 27 ms 15504 KB Output is correct
8 Correct 33 ms 16172 KB Output is correct
9 Correct 33 ms 16152 KB Output is correct
10 Correct 26 ms 13376 KB Output is correct
11 Correct 25 ms 13376 KB Output is correct
12 Correct 26 ms 13468 KB Output is correct
13 Correct 26 ms 13304 KB Output is correct
14 Correct 26 ms 13692 KB Output is correct
15 Correct 28 ms 14000 KB Output is correct
16 Correct 32 ms 16308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 13112 KB Output is correct
2 Correct 0 ms 508 KB Output is correct
3 Correct 22 ms 12744 KB Output is correct
4 Correct 33 ms 14576 KB Output is correct
5 Correct 32 ms 14540 KB Output is correct
6 Correct 27 ms 13272 KB Output is correct
7 Correct 39 ms 13136 KB Output is correct
8 Correct 28 ms 13740 KB Output is correct
9 Correct 28 ms 13800 KB Output is correct
10 Correct 30 ms 13644 KB Output is correct
11 Correct 30 ms 13632 KB Output is correct
12 Correct 31 ms 13668 KB Output is correct
13 Correct 34 ms 13556 KB Output is correct
14 Correct 48 ms 13812 KB Output is correct
15 Correct 34 ms 13796 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 13112 KB Output is correct
2 Correct 0 ms 508 KB Output is correct
3 Correct 22 ms 12744 KB Output is correct
4 Correct 33 ms 14576 KB Output is correct
5 Correct 32 ms 14540 KB Output is correct
6 Correct 27 ms 13272 KB Output is correct
7 Correct 39 ms 13136 KB Output is correct
8 Correct 28 ms 13740 KB Output is correct
9 Correct 28 ms 13800 KB Output is correct
10 Correct 30 ms 13644 KB Output is correct
11 Correct 30 ms 13632 KB Output is correct
12 Correct 31 ms 13668 KB Output is correct
13 Correct 34 ms 13556 KB Output is correct
14 Correct 48 ms 13812 KB Output is correct
15 Correct 34 ms 13796 KB Output is correct
16 Correct 22 ms 11460 KB Output is correct
17 Correct 22 ms 11500 KB Output is correct
18 Correct 30 ms 11372 KB Output is correct
19 Correct 25 ms 11548 KB Output is correct
20 Correct 26 ms 12072 KB Output is correct
21 Correct 26 ms 11792 KB Output is correct
22 Correct 33 ms 13968 KB Output is correct
23 Correct 27 ms 11608 KB Output is correct
24 Correct 24 ms 11608 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 1320 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 1304 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -