답안 #139722

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
139722 2019-08-01T10:11:38 Z win11905 Amusement Park (JOI17_amusement_park) C++14
10 / 100
36 ms 4852 KB
#include <bits/stdc++.h>
#include "Joi.h"
#define long long long
using namespace std;

const int N = 1e4+5;

static int n, m;
static long val;
static vector<int> g[N];
static bool check[N];
static int ptr;

static void dfs(int u) {
  MessageBoard(u, val >> (ptr++) & 1);
  ptr %= 60;
  check[u] = true;
  for(int v : g[u]) if(!check[v]) 
    dfs(v);
}

void Joi(int N, int M, int A[], int B[], long X, int T) {
  n = N, m = M, val = X;
  for(int i = 0; i < m; ++i) {
    g[A[i]].emplace_back(B[i]);
    g[B[i]].emplace_back(A[i]);
  }
  dfs(0);
}
#include <bits/stdc++.h>
#include "Ioi.h"
#define long long long
using namespace std;

const int N = 1e4+5;

static int n, m;
static vector<int> g[N];
static bool check[N];
static int ptr, pos[N];
static vector<int> euler;

static void dfs(int u) {
  pos[u] = ptr++;
  ptr %= 60;
  check[u] = true;
  euler.emplace_back(u);
  for(int v : g[u]) if(!check[v]) {
    dfs(v);
    euler.emplace_back(u);
  }
}

static int cnt;
static long val;
static bool mark[60];

long Ioi(int N, int M, int A[], int B[], int P, int V, int T) {
  n = N, m = M;
  for(int i = 0; i < m; ++i) {
    g[A[i]].emplace_back(B[i]);
    g[B[i]].emplace_back(A[i]);
  }
  dfs(0);
  int z = euler.size();
  for(int i = 0; i < z; ++i) euler.emplace_back(euler[i]);
  ptr = -1;
  while(cnt < 60) {
    ptr++;
    if(cnt == 0 && euler[ptr] != P) continue;
    if(cnt != 0) V = Move(euler[ptr]);
    if(!mark[pos[euler[ptr]]]) mark[pos[euler[ptr]]] = true, cnt++;
    if(V) val |= 1ll << pos[euler[ptr]];
  }
  return val;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 1372 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 4800 KB Output is correct
2 Correct 36 ms 4720 KB Output is correct
3 Correct 33 ms 4820 KB Output is correct
4 Correct 20 ms 3436 KB Output is correct
5 Correct 20 ms 3820 KB Output is correct
6 Correct 23 ms 3480 KB Output is correct
7 Correct 20 ms 3620 KB Output is correct
8 Correct 20 ms 3608 KB Output is correct
9 Correct 22 ms 3632 KB Output is correct
10 Correct 20 ms 3376 KB Output is correct
11 Correct 19 ms 3412 KB Output is correct
12 Correct 19 ms 3212 KB Output is correct
13 Correct 18 ms 3220 KB Output is correct
14 Correct 19 ms 3348 KB Output is correct
15 Correct 20 ms 3360 KB Output is correct
16 Correct 20 ms 3416 KB Output is correct
17 Correct 23 ms 3404 KB Output is correct
18 Correct 22 ms 3404 KB Output is correct
19 Correct 23 ms 3352 KB Output is correct
20 Incorrect 18 ms 3792 KB Wrong Answer [7]
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 1404 KB Output is correct
2 Correct 4 ms 1432 KB Output is correct
3 Correct 4 ms 1364 KB Output is correct
4 Correct 6 ms 1700 KB Output is correct
5 Correct 6 ms 1752 KB Output is correct
6 Correct 6 ms 1696 KB Output is correct
7 Correct 6 ms 1880 KB Output is correct
8 Correct 6 ms 1752 KB Output is correct
9 Correct 18 ms 4036 KB Output is correct
10 Correct 18 ms 4132 KB Output is correct
11 Correct 16 ms 3992 KB Output is correct
12 Correct 5 ms 1272 KB Output is correct
13 Correct 4 ms 1404 KB Output is correct
14 Correct 4 ms 1276 KB Output is correct
15 Correct 4 ms 1292 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 4760 KB Output is correct
2 Partially correct 35 ms 4744 KB Partially correct
3 Partially correct 36 ms 4744 KB Partially correct
4 Correct 20 ms 3360 KB Output is correct
5 Partially correct 23 ms 3844 KB Partially correct
6 Correct 20 ms 3688 KB Output is correct
7 Correct 20 ms 3608 KB Output is correct
8 Correct 20 ms 3608 KB Output is correct
9 Correct 20 ms 3612 KB Output is correct
10 Correct 18 ms 3488 KB Output is correct
11 Correct 19 ms 3484 KB Output is correct
12 Correct 19 ms 3240 KB Output is correct
13 Correct 19 ms 3208 KB Output is correct
14 Correct 19 ms 3308 KB Output is correct
15 Correct 22 ms 3356 KB Output is correct
16 Correct 20 ms 3356 KB Output is correct
17 Correct 20 ms 3352 KB Output is correct
18 Correct 20 ms 3404 KB Output is correct
19 Correct 20 ms 3416 KB Output is correct
20 Incorrect 16 ms 3744 KB Wrong Answer [7]
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 4768 KB Output is correct
2 Correct 32 ms 4852 KB Output is correct
3 Incorrect 32 ms 4744 KB Output isn't correct
4 Halted 0 ms 0 KB -