답안 #481935

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
481935 2021-10-22T09:27:28 Z jesus_coconut Amusement Park (JOI17_amusement_park) C++17
18 / 100
33 ms 4476 KB
#include <bits/stdc++.h>
#include "Joi.h"

using namespace std;
using ll = long long;

void Joi(int N, int M, int A[], int B[], long long X, int T) {
  bool bio[N];
  memset(bio, 0, sizeof bio);
  int p = 0;
  vector<vector<int>> adj(N);
  for (int i = 0; i < M; ++i) {
    adj[A[i]].push_back(B[i]);
    adj[B[i]].push_back(A[i]);
  }
  for (auto &v: adj) sort(begin(v), end(v));
  function<void(int)> dfs = [&](int ver) {
    bio[ver] = true;
    MessageBoard(ver, (X >> p++) & 1);
    for (auto u: adj[ver]) if (!bio[u]) {
      dfs(u);
    }
  };
  dfs(0);
}
#include <bits/stdc++.h>
#include "Ioi.h"

using namespace std;

long long Ioi(int N, int M, int A[], int B[], int P, int V, int T) {
  vector<vector<int>> adj(N);
  for (int i = 0; i < M; ++i) {
    adj[A[i]].push_back(B[i]);
    adj[B[i]].push_back(A[i]);
  }
  for (auto &v: adj) sort(begin(v), end(v));
  int col[N];
  col[P] = V;
  bool bio[N];
  memset(bio, 0, sizeof bio);
  function<void(int, int)> dfsfind = [&](int ver, int par) {
    bio[ver] = true;
    for (auto u: adj[ver]) if (!bio[u]) {
      col[u] = Move(u);
      dfsfind(u, ver);
    }
    if (par != -1) col[par] = Move(par);
  };
  dfsfind(P, -1);
  memset(bio, 0, sizeof bio);
  long long ans = 0;
  int p = 0;
  function<void(int)> dfs = [&](int ver) {
    bio[ver] = true;
    if (p > 63) return;
    ans ^= (1ll * col[ver]) << p++;
    for (auto u: adj[ver]) if (!bio[u]) {
      dfs(u);
    }
  };
  dfs(0);
  return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 492 KB Output is correct
2 Correct 3 ms 584 KB Output is correct
3 Correct 2 ms 760 KB Output is correct
4 Correct 2 ms 500 KB Output is correct
5 Correct 1 ms 492 KB Output is correct
6 Correct 1 ms 584 KB Output is correct
7 Correct 2 ms 760 KB Output is correct
8 Correct 3 ms 752 KB Output is correct
9 Correct 2 ms 624 KB Output is correct
10 Correct 2 ms 504 KB Output is correct
11 Correct 5 ms 948 KB Output is correct
12 Correct 0 ms 492 KB Output is correct
13 Correct 2 ms 760 KB Output is correct
14 Correct 1 ms 624 KB Output is correct
15 Correct 2 ms 624 KB Output is correct
16 Correct 1 ms 632 KB Output is correct
17 Correct 2 ms 760 KB Output is correct
18 Correct 2 ms 756 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 4404 KB Output is correct
2 Correct 23 ms 4328 KB Output is correct
3 Correct 25 ms 4476 KB Output is correct
4 Correct 16 ms 2596 KB Output is correct
5 Correct 22 ms 3628 KB Output is correct
6 Correct 16 ms 3176 KB Output is correct
7 Correct 14 ms 3108 KB Output is correct
8 Correct 16 ms 3104 KB Output is correct
9 Correct 15 ms 3128 KB Output is correct
10 Correct 13 ms 2624 KB Output is correct
11 Correct 14 ms 2692 KB Output is correct
12 Correct 16 ms 2312 KB Output is correct
13 Correct 15 ms 2340 KB Output is correct
14 Correct 17 ms 2440 KB Output is correct
15 Correct 14 ms 2596 KB Output is correct
16 Correct 16 ms 2464 KB Output is correct
17 Correct 16 ms 2616 KB Output is correct
18 Correct 14 ms 2620 KB Output is correct
19 Correct 14 ms 2568 KB Output is correct
20 Correct 12 ms 2992 KB Output is correct
21 Correct 11 ms 3004 KB Output is correct
22 Correct 22 ms 2844 KB Output is correct
23 Correct 17 ms 2976 KB Output is correct
24 Correct 15 ms 2964 KB Output is correct
25 Correct 14 ms 2960 KB Output is correct
26 Correct 16 ms 2972 KB Output is correct
27 Correct 14 ms 2956 KB Output is correct
28 Correct 15 ms 3020 KB Output is correct
29 Correct 14 ms 2816 KB Output is correct
30 Correct 14 ms 2840 KB Output is correct
31 Correct 1 ms 600 KB Output is correct
32 Correct 1 ms 492 KB Output is correct
33 Correct 1 ms 628 KB Output is correct
34 Correct 1 ms 492 KB Output is correct
35 Correct 1 ms 572 KB Output is correct
36 Correct 1 ms 500 KB Output is correct
37 Correct 1 ms 472 KB Output is correct
38 Correct 0 ms 500 KB Output is correct
39 Correct 2 ms 492 KB Output is correct
40 Correct 0 ms 492 KB Output is correct
41 Correct 1 ms 500 KB Output is correct
42 Correct 1 ms 500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 500 KB Output is correct
2 Correct 0 ms 492 KB Output is correct
3 Correct 0 ms 492 KB Output is correct
4 Incorrect 3 ms 1056 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 29 ms 4440 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 33 ms 4412 KB Output isn't correct
2 Halted 0 ms 0 KB -