답안 #41782

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
41782 2018-02-21T08:18:11 Z cmaster Amusement Park (JOI17_amusement_park) C++14
18 / 100
41 ms 13808 KB
#include <bits/stdc++.h>
#include "Joi.h"
using namespace std;
static const int MAXN2 = (int)2e5+228;
static int val2[MAXN2], used2[MAXN2];
static vector < int > g2[MAXN2];
static long long tmp, XX;

void Joi(int n, int m, int A[], int B[], long long X, int T) {
  for(int i = 0; i < n; i++){
    val2[i] = -1; used2[i] = 0;
    g2[i].clear();
  }
  for(int i = 0; i < m; ++i) {
		g2[A[i]].push_back(B[i]);
		g2[B[i]].push_back(A[i]);
  }
  XX = X;
	for(int i = 0; i < 60; ++i) MessageBoard(i, (bool)((1ll<<i*1ll)&X));
	for(int i = 60; i < n; ++i) MessageBoard(i, 0);
}
#include "Ioi.h"
#include <bits/stdc++.h>
using namespace std;
static const int MAXN1 = (int)2e5+228;
static bool used1[MAXN1];
static vector < int > g1[MAXN1];
static int val1[MAXN1];
static long long ret = 0ll;

void dfs1(int v) {
	used1[v] = 1;
	for(auto &to : g1[v]) {
		if(!used1[to]) {
			val1[to] = Move(to);
			dfs1(to);
			Move(v);
		}
	}
}

long long Ioi(int n, int m, int A[], int B[], int P, int V, int T) {
	for(int i = 0; i < n; ++i) {
		used1[i] = 0;
		val1[i] = -1;
		g1[i].clear();
	}
	val1[P] = V;
	for(int i = 0; i < m; ++i) {
		g1[A[i]].push_back(B[i]);
		g1[B[i]].push_back(A[i]);
	}
	ret = 0ll;
	dfs1(P);
	for(int i = 0; i < 60; ++i) ret |= ((1ll << i*1ll)*val1[i]);
  return ret;
}

Compilation message

Joi.cpp:7:18: warning: 'tmp' defined but not used [-Wunused-variable]
 static long long tmp, XX;
                  ^
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 10120 KB Output is correct
2 Correct 11 ms 10444 KB Output is correct
3 Correct 13 ms 10644 KB Output is correct
4 Correct 11 ms 10656 KB Output is correct
5 Correct 11 ms 10656 KB Output is correct
6 Correct 12 ms 10656 KB Output is correct
7 Correct 11 ms 10672 KB Output is correct
8 Correct 12 ms 10704 KB Output is correct
9 Correct 14 ms 10736 KB Output is correct
10 Correct 10 ms 10760 KB Output is correct
11 Correct 17 ms 11136 KB Output is correct
12 Correct 11 ms 11136 KB Output is correct
13 Correct 10 ms 11136 KB Output is correct
14 Correct 10 ms 11136 KB Output is correct
15 Correct 12 ms 11136 KB Output is correct
16 Correct 10 ms 11136 KB Output is correct
17 Correct 11 ms 11136 KB Output is correct
18 Correct 10 ms 11136 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 41 ms 13316 KB Output is correct
2 Correct 40 ms 13724 KB Output is correct
3 Correct 41 ms 13808 KB Output is correct
4 Correct 28 ms 13808 KB Output is correct
5 Correct 34 ms 13808 KB Output is correct
6 Correct 28 ms 13808 KB Output is correct
7 Correct 34 ms 13808 KB Output is correct
8 Correct 34 ms 13808 KB Output is correct
9 Correct 26 ms 13808 KB Output is correct
10 Correct 27 ms 13808 KB Output is correct
11 Correct 38 ms 13808 KB Output is correct
12 Correct 25 ms 13808 KB Output is correct
13 Correct 33 ms 13808 KB Output is correct
14 Correct 34 ms 13808 KB Output is correct
15 Correct 26 ms 13808 KB Output is correct
16 Correct 27 ms 13808 KB Output is correct
17 Correct 40 ms 13808 KB Output is correct
18 Correct 27 ms 13808 KB Output is correct
19 Correct 30 ms 13808 KB Output is correct
20 Correct 22 ms 13808 KB Output is correct
21 Correct 25 ms 13808 KB Output is correct
22 Correct 31 ms 13808 KB Output is correct
23 Correct 27 ms 13808 KB Output is correct
24 Correct 27 ms 13808 KB Output is correct
25 Correct 35 ms 13808 KB Output is correct
26 Correct 28 ms 13808 KB Output is correct
27 Correct 27 ms 13808 KB Output is correct
28 Correct 31 ms 13808 KB Output is correct
29 Correct 25 ms 13808 KB Output is correct
30 Correct 27 ms 13808 KB Output is correct
31 Correct 10 ms 13808 KB Output is correct
32 Correct 11 ms 13808 KB Output is correct
33 Correct 11 ms 13808 KB Output is correct
34 Correct 11 ms 13808 KB Output is correct
35 Correct 10 ms 13808 KB Output is correct
36 Correct 10 ms 13808 KB Output is correct
37 Correct 10 ms 13808 KB Output is correct
38 Correct 10 ms 13808 KB Output is correct
39 Correct 10 ms 13808 KB Output is correct
40 Correct 12 ms 13808 KB Output is correct
41 Correct 10 ms 13808 KB Output is correct
42 Correct 10 ms 13808 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 13808 KB Output is correct
2 Correct 11 ms 13808 KB Output is correct
3 Correct 11 ms 13808 KB Output is correct
4 Incorrect 13 ms 13808 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 39 ms 13808 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 38 ms 13808 KB Output isn't correct
2 Halted 0 ms 0 KB -