Submission #61105

# Submission time Handle Problem Language Result Execution time Memory
61105 2018-07-25T08:09:08 Z 윤교준(#1762) Broken Device (JOI17_broken_device) C++11
85 / 100
77 ms 4216 KB
#include "Annalib.h"
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define allv(V) ((V).begin()),((V).end())
#define sorv(V) sort(allv(V))
#define univ(V) (V).erase(unique(allv(V)),(V).end())
#define revv(V) reverse(allv(V))
#define sz(V) ((int)(V).size())
#define upmin(a,b) (a)=min((a),(b))
#define upmax(a,b) (a)=max((a),(b))
#define rb(x) ((x)&(-(x)))
#define INF (0x3f3f3f3f)
#define INFLL (0x3f3f3f3f3f3f3f3fll)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

static int A[150];

void Anna(int N, ll X, int K, int P[]) {
	fill(A, A+150, 1);
	for(int i = 0; i < K; i++)
		A[P[i]] = A[P[i]^1] = 0;
	
	vector<int> V;
	for(int i = 0; i < 38; i++) {
		V.eb(X % 3);
		X /= 3;
	}

	for(int i = 0; i < N; i += 2) if(A[i] && A[i|1]) {
		if(V.empty()) break;
		int t = V.back(); V.pop_back();
		if(!t) A[i] = 0;
		else if(1 == t) A[i|1] = 0;
	}

	for(int i = 0; i < N; i++) Set(i, !!A[i]);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define allv(V) ((V).begin()),((V).end())
#define sorv(V) sort(allv(V))
#define univ(V) (V).erase(unique(allv(V)),(V).end())
#define revv(V) reverse(allv(V))
#define sz(V) ((int)(V).size())
#define upmin(a,b) (a)=min((a),(b))
#define upmax(a,b) (a)=max((a),(b))
#define rb(x) ((x)&(-(x)))
#define INF (0x3f3f3f3f)
#define INFLL (0x3f3f3f3f3f3f3f3fll)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

ll Bruno(int N, int A[]) {
	ll ret = 0;
	for(int i = 0, j = 0; i < N && j < 38; i += 2) if(A[i] || A[i|1]) {
		ret *= 3;
		if(A[i] && !A[i|1]) ret++;
		else if(A[i] && A[i|1]) ret += 2;
		j++;
	}
	return ret;
}
# Verdict Execution time Memory Grader output
1 Partially correct 48 ms 2800 KB Output is partially correct - L* = 37
2 Partially correct 48 ms 3264 KB Output is partially correct - L* = 37
3 Partially correct 41 ms 3264 KB Output is partially correct - L* = 37
4 Partially correct 46 ms 3264 KB Output is partially correct - L* = 37
5 Partially correct 45 ms 3512 KB Output is partially correct - L* = 37
6 Partially correct 59 ms 3512 KB Output is partially correct - L* = 37
7 Partially correct 50 ms 3648 KB Output is partially correct - L* = 37
8 Partially correct 49 ms 3648 KB Output is partially correct - L* = 37
9 Partially correct 54 ms 3648 KB Output is partially correct - L* = 37
10 Partially correct 69 ms 3688 KB Output is partially correct - L* = 37
11 Partially correct 51 ms 3712 KB Output is partially correct - L* = 37
12 Partially correct 52 ms 3712 KB Output is partially correct - L* = 37
13 Partially correct 69 ms 3712 KB Output is partially correct - L* = 37
14 Partially correct 47 ms 3712 KB Output is partially correct - L* = 37
15 Partially correct 43 ms 3712 KB Output is partially correct - L* = 37
16 Partially correct 51 ms 3712 KB Output is partially correct - L* = 37
17 Partially correct 57 ms 3736 KB Output is partially correct - L* = 37
18 Partially correct 69 ms 4216 KB Output is partially correct - L* = 37
19 Partially correct 73 ms 4216 KB Output is partially correct - L* = 37
20 Partially correct 67 ms 4216 KB Output is partially correct - L* = 37
21 Partially correct 49 ms 4216 KB Output is partially correct - L* = 37
22 Partially correct 55 ms 4216 KB Output is partially correct - L* = 37
23 Partially correct 46 ms 4216 KB Output is partially correct - L* = 37
24 Partially correct 49 ms 4216 KB Output is partially correct - L* = 37
25 Partially correct 57 ms 4216 KB Output is partially correct - L* = 37
26 Partially correct 77 ms 4216 KB Output is partially correct - L* = 37
27 Partially correct 48 ms 4216 KB Output is partially correct - L* = 37
28 Partially correct 50 ms 4216 KB Output is partially correct - L* = 37
29 Partially correct 51 ms 4216 KB Output is partially correct - L* = 37
30 Partially correct 49 ms 4216 KB Output is partially correct - L* = 37
31 Partially correct 54 ms 4216 KB Output is partially correct - L* = 37
32 Partially correct 45 ms 4216 KB Output is partially correct - L* = 37
33 Partially correct 47 ms 4216 KB Output is partially correct - L* = 37
34 Partially correct 76 ms 4216 KB Output is partially correct - L* = 37
35 Partially correct 48 ms 4216 KB Output is partially correct - L* = 37
36 Partially correct 44 ms 4216 KB Output is partially correct - L* = 37
37 Partially correct 50 ms 4216 KB Output is partially correct - L* = 37
38 Partially correct 69 ms 4216 KB Output is partially correct - L* = 37
39 Partially correct 52 ms 4216 KB Output is partially correct - L* = 37
40 Partially correct 59 ms 4216 KB Output is partially correct - L* = 37