Submission #207615

# Submission time Handle Problem Language Result Execution time Memory
207615 2020-03-08T06:44:39 Z autumn_eel Broken Device (JOI17_broken_device) C++14
85 / 100
1101 ms 3360 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[]){
	static mt19937 mt(314159);
	memset(b,0,sizeof(b));
	memset(d,0,sizeof(d));
	memset(used,0,sizeof(used));
	rep(i,K){
		b[P[i]]=1;
	}
	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[]){
	static mt19937 mt(314159);
	bool used[160]{};
	ll ans=0,x=1;
	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 1062 ms 3064 KB Output is partially correct - L* = 39
2 Partially correct 1057 ms 3056 KB Output is partially correct - L* = 38
3 Partially correct 1063 ms 3192 KB Output is partially correct - L* = 38
4 Partially correct 1059 ms 3056 KB Output is partially correct - L* = 38
5 Partially correct 1060 ms 3056 KB Output is partially correct - L* = 38
6 Partially correct 1059 ms 3056 KB Output is partially correct - L* = 38
7 Partially correct 1066 ms 3312 KB Output is partially correct - L* = 37
8 Partially correct 1061 ms 2984 KB Output is partially correct - L* = 37
9 Partially correct 1056 ms 3056 KB Output is partially correct - L* = 37
10 Partially correct 1063 ms 2904 KB Output is partially correct - L* = 38
11 Partially correct 1058 ms 3336 KB Output is partially correct - L* = 38
12 Partially correct 1069 ms 3064 KB Output is partially correct - L* = 37
13 Partially correct 1059 ms 3360 KB Output is partially correct - L* = 39
14 Partially correct 1064 ms 3056 KB Output is partially correct - L* = 38
15 Partially correct 1066 ms 3056 KB Output is partially correct - L* = 37
16 Partially correct 1060 ms 3056 KB Output is partially correct - L* = 38
17 Partially correct 1082 ms 3056 KB Output is partially correct - L* = 37
18 Partially correct 1070 ms 3136 KB Output is partially correct - L* = 38
19 Partially correct 1064 ms 3056 KB Output is partially correct - L* = 38
20 Partially correct 1078 ms 3056 KB Output is partially correct - L* = 38
21 Partially correct 1086 ms 3104 KB Output is partially correct - L* = 38
22 Partially correct 1071 ms 3168 KB Output is partially correct - L* = 39
23 Partially correct 1074 ms 3056 KB Output is partially correct - L* = 38
24 Partially correct 1101 ms 3312 KB Output is partially correct - L* = 38
25 Partially correct 1055 ms 2880 KB Output is partially correct - L* = 38
26 Partially correct 1061 ms 3008 KB Output is partially correct - L* = 38
27 Partially correct 1074 ms 3056 KB Output is partially correct - L* = 37
28 Partially correct 1053 ms 3056 KB Output is partially correct - L* = 38
29 Partially correct 1065 ms 3056 KB Output is partially correct - L* = 38
30 Partially correct 1071 ms 3312 KB Output is partially correct - L* = 39
31 Partially correct 1075 ms 3000 KB Output is partially correct - L* = 38
32 Partially correct 1061 ms 3056 KB Output is partially correct - L* = 37
33 Partially correct 1062 ms 3312 KB Output is partially correct - L* = 38
34 Partially correct 1068 ms 3056 KB Output is partially correct - L* = 38
35 Partially correct 1062 ms 3312 KB Output is partially correct - L* = 39
36 Partially correct 1065 ms 3312 KB Output is partially correct - L* = 39
37 Partially correct 1052 ms 3312 KB Output is partially correct - L* = 39
38 Correct 1062 ms 3056 KB Output is correct - L* = 40
39 Partially correct 1058 ms 3056 KB Output is partially correct - L* = 38
40 Partially correct 1071 ms 3056 KB Output is partially correct - L* = 38