Submission #260789

# Submission time Handle Problem Language Result Execution time Memory
260789 2020-08-11T01:50:20 Z arnold518 Broken Device (JOI17_broken_device) C++14
85 / 100
51 ms 3584 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

static const int MAXN = 150;
static const int MAXK = 40;

static int N, K, *P;
static ll X;
static int A[MAXN+10];

void Anna(int _N, ll _X, int _K, int _P[])
{
	N=_N; X=_X; K=_K; P=_P;
	for(int i=0; i<K; i++) A[P[i]]=-1;

	ll now=X;
	for(int i=0; i<N; i+=2)
	{
		if(A[i]==-1 || A[i+1]==-1)
		{
			A[i]=0; A[i+1]=0;
		}
		else
		{
			if(now%3==0) A[i]=0, A[i+1]=1;
			else if(now%3==1) A[i]=1, A[i+1]=0;
			else if(now%3==2) A[i]=1, A[i+1]=1;
			now/=3;
		}
	}
	for(int i=0; i<N; i++) Set(i, A[i]);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

static int N, *A;

ll Bruno(int _N, int _A[])
{
	N=_N; A=_A;
	ll ret=0;
	for(int i=N-2; i>=0; i-=2)
	{
		if(A[i]==0 && A[i+1]==0) continue;
		if(A[i]==0 && A[i+1]==1) ret=ret*3+0;
		if(A[i]==1 && A[i+1]==0) ret=ret*3+1;
		if(A[i]==1 && A[i+1]==1) ret=ret*3+2;
	}
	return ret;
}
# Verdict Execution time Memory Grader output
1 Partially correct 46 ms 3328 KB Output is partially correct - L* = 37
2 Partially correct 45 ms 3320 KB Output is partially correct - L* = 37
3 Partially correct 44 ms 3312 KB Output is partially correct - L* = 37
4 Partially correct 45 ms 3328 KB Output is partially correct - L* = 37
5 Partially correct 47 ms 3312 KB Output is partially correct - L* = 37
6 Partially correct 44 ms 3328 KB Output is partially correct - L* = 37
7 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
8 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
9 Partially correct 46 ms 3328 KB Output is partially correct - L* = 37
10 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
11 Partially correct 45 ms 3320 KB Output is partially correct - L* = 37
12 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
13 Partially correct 45 ms 3328 KB Output is partially correct - L* = 37
14 Partially correct 45 ms 3328 KB Output is partially correct - L* = 37
15 Partially correct 47 ms 3328 KB Output is partially correct - L* = 37
16 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
17 Partially correct 44 ms 3312 KB Output is partially correct - L* = 37
18 Partially correct 45 ms 3328 KB Output is partially correct - L* = 37
19 Partially correct 49 ms 3312 KB Output is partially correct - L* = 37
20 Partially correct 48 ms 3328 KB Output is partially correct - L* = 37
21 Partially correct 51 ms 3312 KB Output is partially correct - L* = 37
22 Partially correct 46 ms 3312 KB Output is partially correct - L* = 37
23 Partially correct 44 ms 3376 KB Output is partially correct - L* = 37
24 Partially correct 45 ms 3328 KB Output is partially correct - L* = 37
25 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
26 Partially correct 46 ms 3312 KB Output is partially correct - L* = 37
27 Partially correct 45 ms 3328 KB Output is partially correct - L* = 37
28 Partially correct 46 ms 3312 KB Output is partially correct - L* = 37
29 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
30 Partially correct 46 ms 3336 KB Output is partially correct - L* = 37
31 Partially correct 46 ms 3584 KB Output is partially correct - L* = 37
32 Partially correct 45 ms 3320 KB Output is partially correct - L* = 37
33 Partially correct 44 ms 3328 KB Output is partially correct - L* = 37
34 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
35 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
36 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
37 Partially correct 45 ms 3328 KB Output is partially correct - L* = 37
38 Partially correct 45 ms 3312 KB Output is partially correct - L* = 37
39 Partially correct 48 ms 3328 KB Output is partially correct - L* = 37
40 Partially correct 45 ms 3328 KB Output is partially correct - L* = 37