Submission #207611

# Submission time Handle Problem Language Result Execution time Memory
207611 2020-03-08T06:28:00 Z autumn_eel Broken Device (JOI17_broken_device) C++14
85 / 100
812 ms 3312 KB
#include "Annalib.h"
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

bool b[160],d[160];
bool used[160];

void Anna(int N,ll X,int K,int P[]){
	memset(b,0,sizeof(b));
	memset(d,0,sizeof(d));
	memset(used,0,sizeof(used));
	rep(i,K){
		b[P[i]]=1;
	}
	mt19937 mt(3141592);
	rep(loop,N/2){
		int i,j;
		do{
			i=mt()%N;
			j=mt()%N;
		}while(i==j||used[i]||used[j]);
		used[i]=used[j]=true;
		if(!b[i]&&!b[j]){
			int e=X%3;
			if(e==0)d[i]=0,d[j]=1;
			if(e==1)d[i]=1,d[j]=0;
			if(e==2)d[i]=1,d[j]=1;
			X/=3;
		}
	}
	rep(i,N)Set(i,d[i]);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

ll Bruno(int N,int A[]){
	bool used[160]{};
	ll ans=0,x=1;
	mt19937 mt(3141592);
	rep(loop,N/2){
		int i,j;
		do{
			i=mt()%N;
			j=mt()%N;
		}while(i==j||used[i]||used[j]);
		used[i]=used[j]=true;
		if(A[i]||A[j]){
			ans+=(A[i]*2+A[j]-1)*x;
			x*=3;
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 810 ms 3056 KB Output is partially correct - L* = 39
2 Partially correct 796 ms 3056 KB Output is partially correct - L* = 38
3 Partially correct 792 ms 3056 KB Output is partially correct - L* = 39
4 Partially correct 794 ms 3056 KB Output is partially correct - L* = 39
5 Partially correct 796 ms 3056 KB Output is partially correct - L* = 38
6 Partially correct 798 ms 3056 KB Output is partially correct - L* = 39
7 Partially correct 790 ms 3056 KB Output is partially correct - L* = 39
8 Partially correct 794 ms 3056 KB Output is partially correct - L* = 39
9 Partially correct 790 ms 3056 KB Output is partially correct - L* = 39
10 Partially correct 796 ms 3064 KB Output is partially correct - L* = 38
11 Partially correct 798 ms 3056 KB Output is partially correct - L* = 37
12 Partially correct 789 ms 3056 KB Output is partially correct - L* = 38
13 Partially correct 790 ms 3056 KB Output is partially correct - L* = 38
14 Partially correct 792 ms 3056 KB Output is partially correct - L* = 37
15 Partially correct 787 ms 3056 KB Output is partially correct - L* = 39
16 Partially correct 800 ms 3056 KB Output is partially correct - L* = 39
17 Partially correct 789 ms 3056 KB Output is partially correct - L* = 39
18 Partially correct 800 ms 3056 KB Output is partially correct - L* = 38
19 Partially correct 794 ms 3056 KB Output is partially correct - L* = 38
20 Partially correct 812 ms 2944 KB Output is partially correct - L* = 38
21 Partially correct 811 ms 3064 KB Output is partially correct - L* = 38
22 Partially correct 798 ms 2944 KB Output is partially correct - L* = 39
23 Partially correct 806 ms 3056 KB Output is partially correct - L* = 38
24 Partially correct 798 ms 3056 KB Output is partially correct - L* = 39
25 Partially correct 796 ms 3056 KB Output is partially correct - L* = 39
26 Partially correct 796 ms 3056 KB Output is partially correct - L* = 39
27 Partially correct 788 ms 3056 KB Output is partially correct - L* = 39
28 Partially correct 791 ms 3056 KB Output is partially correct - L* = 39
29 Partially correct 798 ms 3056 KB Output is partially correct - L* = 39
30 Partially correct 804 ms 3056 KB Output is partially correct - L* = 39
31 Partially correct 791 ms 3072 KB Output is partially correct - L* = 39
32 Partially correct 804 ms 3056 KB Output is partially correct - L* = 39
33 Partially correct 798 ms 3056 KB Output is partially correct - L* = 39
34 Partially correct 792 ms 3056 KB Output is partially correct - L* = 39
35 Partially correct 794 ms 3056 KB Output is partially correct - L* = 39
36 Partially correct 794 ms 3312 KB Output is partially correct - L* = 39
37 Partially correct 796 ms 3056 KB Output is partially correct - L* = 39
38 Partially correct 792 ms 3312 KB Output is partially correct - L* = 39
39 Partially correct 794 ms 3056 KB Output is partially correct - L* = 38
40 Partially correct 795 ms 3312 KB Output is partially correct - L* = 39