Submission #897234

# Submission time Handle Problem Language Result Execution time Memory
897234 2024-01-02T19:08:16 Z box Stray Cat (JOI20_stray) C++17
15 / 100
36 ms 16696 KB
#include "Anthony.h"
#include <vector>

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

#ifdef LOCAL
template <class T, class... U> void bug_h(const T& t, const U&... u) { cerr << t; ((cerr << " | " << u), ...); cerr << endl; }
#define bug(...) cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]: ", bug_h(__VA_ARGS__)
#else
#define cerr if (0) cerr
#define bug(...)
#endif

#define ar array
#define all(v) std::begin(v), std::end(v)
#define sz(v) int(std::size(v))
typedef long long i64;
typedef vector<int> vi;
typedef pair<int, int> pi;

namespace {

int FunctionExample(int i, int A) {
  return i % A;
}

}  // namespace

vi Mark(int N, int M, int A, int B, vi U, vi V) {
  vi X(M);
  vector<vi> adj(N);
  for (int i = 0; i < M; i++) {
    adj[U[i]].push_back(i);
    adj[V[i]].push_back(i);
  }
  vi D(N, -1);
  queue<int> qu;
  D[0] = 0, qu.push(0);
  while (sz(qu)) {
    int i = qu.front(); qu.pop();
    for (int h : adj[i]) {
      int j = i ^ U[h] ^ V[h];
      if (D[j] == -1) {
        D[j] = D[i] + 1;
        qu.push(j);
      }
    }
  }
  for (int i = 0; i < M; i++) {
    X[i] = min(D[U[i]], D[V[i]]) % 3;
  }
  return X;
}
#include "Catherine.h"
#include <vector>

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

#ifdef LOCAL
template <class T, class... U> void bug_h(const T& t, const U&... u) { cerr << t; ((cerr << " | " << u), ...); cerr << endl; }
#define bug(...) cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]: ", bug_h(__VA_ARGS__)
#else
#define cerr if (0) cerr
#define bug(...)
#endif

#define ar array
#define all(v) std::begin(v), std::end(v)
#define sz(v) int(std::size(v))
typedef long long i64;
typedef vector<int> vi;
typedef pair<int, int> pi;

namespace {

int A, B;
int variable_example = 0;

}  // namespace

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

int Move(vi y) {
  if (!y[0]) return y[1] ? 1 : 2;
  if (!y[1]) return y[2] ? 2 : 0;
  if (!y[2]) return y[0] ? 0 : 1;
  return -1;
}

Compilation message

Anthony.cpp:24:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
   24 | int FunctionExample(int i, int A) {
      |     ^~~~~~~~~~~~~~~

Catherine.cpp:25:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   25 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 30 ms 15608 KB Output is correct
2 Correct 0 ms 800 KB Output is correct
3 Correct 23 ms 14924 KB Output is correct
4 Correct 34 ms 16696 KB Output is correct
5 Correct 34 ms 16696 KB Output is correct
6 Correct 32 ms 15508 KB Output is correct
7 Correct 30 ms 15456 KB Output is correct
8 Correct 31 ms 16052 KB Output is correct
9 Correct 32 ms 16224 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 15608 KB Output is correct
2 Correct 0 ms 800 KB Output is correct
3 Correct 23 ms 14924 KB Output is correct
4 Correct 34 ms 16696 KB Output is correct
5 Correct 34 ms 16696 KB Output is correct
6 Correct 32 ms 15508 KB Output is correct
7 Correct 30 ms 15456 KB Output is correct
8 Correct 31 ms 16052 KB Output is correct
9 Correct 32 ms 16224 KB Output is correct
10 Correct 26 ms 13508 KB Output is correct
11 Correct 26 ms 13504 KB Output is correct
12 Correct 25 ms 13520 KB Output is correct
13 Correct 26 ms 13500 KB Output is correct
14 Correct 26 ms 13756 KB Output is correct
15 Correct 27 ms 14032 KB Output is correct
16 Correct 31 ms 16212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 13152 KB Output is correct
2 Correct 0 ms 796 KB Output is correct
3 Correct 25 ms 12712 KB Output is correct
4 Correct 36 ms 14872 KB Output is correct
5 Correct 33 ms 14604 KB Output is correct
6 Correct 26 ms 13156 KB Output is correct
7 Correct 26 ms 13100 KB Output is correct
8 Correct 28 ms 13848 KB Output is correct
9 Correct 28 ms 13920 KB Output is correct
10 Correct 27 ms 13632 KB Output is correct
11 Correct 30 ms 13684 KB Output is correct
12 Correct 27 ms 13624 KB Output is correct
13 Correct 35 ms 13524 KB Output is correct
14 Correct 30 ms 13916 KB Output is correct
15 Correct 30 ms 13888 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 13152 KB Output is correct
2 Correct 0 ms 796 KB Output is correct
3 Correct 25 ms 12712 KB Output is correct
4 Correct 36 ms 14872 KB Output is correct
5 Correct 33 ms 14604 KB Output is correct
6 Correct 26 ms 13156 KB Output is correct
7 Correct 26 ms 13100 KB Output is correct
8 Correct 28 ms 13848 KB Output is correct
9 Correct 28 ms 13920 KB Output is correct
10 Correct 27 ms 13632 KB Output is correct
11 Correct 30 ms 13684 KB Output is correct
12 Correct 27 ms 13624 KB Output is correct
13 Correct 35 ms 13524 KB Output is correct
14 Correct 30 ms 13916 KB Output is correct
15 Correct 30 ms 13888 KB Output is correct
16 Correct 23 ms 11588 KB Output is correct
17 Correct 24 ms 11664 KB Output is correct
18 Correct 28 ms 11516 KB Output is correct
19 Correct 25 ms 11456 KB Output is correct
20 Correct 26 ms 12240 KB Output is correct
21 Correct 27 ms 11848 KB Output is correct
22 Correct 28 ms 14176 KB Output is correct
23 Correct 26 ms 11692 KB Output is correct
24 Correct 25 ms 11732 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 796 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2804 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2800 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -