Submission #61120

# Submission time Handle Problem Language Result Execution time Memory
61120 2018-07-25T08:23:00 Z 윤교준(#1762) Broken Device (JOI17_broken_device) C++11
67 / 100
84 ms 3840 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 __int128_t lll;
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, t; i < K; i++) {
		t = P[i]/3*3;
		A[t] = A[t+1] = A[t+2] = 0;
	}
	
	vector<int> V;
	for(int i = 0; i < 22; i++) {
		V.eb(X % 7);
		X /= 7;
	}

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

	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 < 22; i += 3) if(A[i] || A[i+1] || A[i+2]) {
		ret *= 7;
		ret += (A[i]<<2) | (A[i+1]<<1) | A[i+2];
		ret--;
		j++;
	}
	return ret;
}
# Verdict Execution time Memory Grader output
1 Partially correct 77 ms 3056 KB Output is partially correct - L* = 28
2 Partially correct 70 ms 3272 KB Output is partially correct - L* = 28
3 Partially correct 51 ms 3512 KB Output is partially correct - L* = 28
4 Partially correct 64 ms 3816 KB Output is partially correct - L* = 28
5 Partially correct 64 ms 3816 KB Output is partially correct - L* = 28
6 Partially correct 50 ms 3816 KB Output is partially correct - L* = 28
7 Partially correct 55 ms 3816 KB Output is partially correct - L* = 28
8 Partially correct 48 ms 3816 KB Output is partially correct - L* = 29
9 Partially correct 52 ms 3824 KB Output is partially correct - L* = 28
10 Partially correct 71 ms 3824 KB Output is partially correct - L* = 28
11 Partially correct 78 ms 3840 KB Output is partially correct - L* = 28
12 Partially correct 72 ms 3840 KB Output is partially correct - L* = 28
13 Partially correct 55 ms 3840 KB Output is partially correct - L* = 28
14 Partially correct 48 ms 3840 KB Output is partially correct - L* = 28
15 Partially correct 58 ms 3840 KB Output is partially correct - L* = 28
16 Partially correct 47 ms 3840 KB Output is partially correct - L* = 28
17 Partially correct 55 ms 3840 KB Output is partially correct - L* = 31
18 Partially correct 46 ms 3840 KB Output is partially correct - L* = 28
19 Partially correct 56 ms 3840 KB Output is partially correct - L* = 28
20 Partially correct 60 ms 3840 KB Output is partially correct - L* = 29
21 Partially correct 56 ms 3840 KB Output is partially correct - L* = 28
22 Partially correct 59 ms 3840 KB Output is partially correct - L* = 28
23 Partially correct 57 ms 3840 KB Output is partially correct - L* = 28
24 Partially correct 55 ms 3840 KB Output is partially correct - L* = 28
25 Partially correct 57 ms 3840 KB Output is partially correct - L* = 28
26 Partially correct 59 ms 3840 KB Output is partially correct - L* = 28
27 Partially correct 59 ms 3840 KB Output is partially correct - L* = 28
28 Partially correct 80 ms 3840 KB Output is partially correct - L* = 28
29 Partially correct 70 ms 3840 KB Output is partially correct - L* = 29
30 Partially correct 57 ms 3840 KB Output is partially correct - L* = 28
31 Partially correct 73 ms 3840 KB Output is partially correct - L* = 28
32 Partially correct 48 ms 3840 KB Output is partially correct - L* = 28
33 Partially correct 66 ms 3840 KB Output is partially correct - L* = 28
34 Partially correct 67 ms 3840 KB Output is partially correct - L* = 28
35 Partially correct 84 ms 3840 KB Output is partially correct - L* = 28
36 Partially correct 64 ms 3840 KB Output is partially correct - L* = 28
37 Partially correct 77 ms 3840 KB Output is partially correct - L* = 28
38 Partially correct 68 ms 3840 KB Output is partially correct - L* = 28
39 Partially correct 57 ms 3840 KB Output is partially correct - L* = 28
40 Partially correct 59 ms 3840 KB Output is partially correct - L* = 28