답안 #207612

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
207612 2020-03-08T06:31:47 Z autumn_eel Broken Device (JOI17_broken_device) C++14
85 / 100
1137 ms 3568 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];
int step;

void Anna(int N,ll X,int K,int P[]){
	step++;
	memset(b,0,sizeof(b));
	memset(d,0,sizeof(d));
	memset(used,0,sizeof(used));
	rep(i,K){
		b[P[i]]=1;
	}
	mt19937 mt(314159*step);
	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 int step=0;
	step++;
	bool used[160]{};
	ll ans=0,x=1;
	mt19937 mt(314159*step);;
	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;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1121 ms 3064 KB Output is partially correct - L* = 38
2 Partially correct 1119 ms 3312 KB Output is partially correct - L* = 38
3 Partially correct 1116 ms 3320 KB Output is partially correct - L* = 38
4 Partially correct 1118 ms 3168 KB Output is partially correct - L* = 37
5 Partially correct 1126 ms 3312 KB Output is partially correct - L* = 39
6 Partially correct 1131 ms 3320 KB Output is partially correct - L* = 38
7 Partially correct 1126 ms 3056 KB Output is partially correct - L* = 39
8 Partially correct 1113 ms 3056 KB Output is partially correct - L* = 38
9 Partially correct 1127 ms 3152 KB Output is partially correct - L* = 39
10 Partially correct 1137 ms 2904 KB Output is partially correct - L* = 38
11 Partially correct 1112 ms 3568 KB Output is partially correct - L* = 39
12 Partially correct 1117 ms 3168 KB Output is partially correct - L* = 38
13 Partially correct 1116 ms 3056 KB Output is partially correct - L* = 38
14 Partially correct 1117 ms 3312 KB Output is partially correct - L* = 38
15 Partially correct 1121 ms 3440 KB Output is partially correct - L* = 38
16 Partially correct 1114 ms 3104 KB Output is partially correct - L* = 38
17 Partially correct 1108 ms 3056 KB Output is partially correct - L* = 38
18 Partially correct 1115 ms 3120 KB Output is partially correct - L* = 39
19 Partially correct 1104 ms 3056 KB Output is partially correct - L* = 38
20 Partially correct 1111 ms 3056 KB Output is partially correct - L* = 39
21 Partially correct 1115 ms 3344 KB Output is partially correct - L* = 38
22 Partially correct 1112 ms 2864 KB Output is partially correct - L* = 38
23 Partially correct 1110 ms 3056 KB Output is partially correct - L* = 38
24 Partially correct 1116 ms 3056 KB Output is partially correct - L* = 38
25 Partially correct 1124 ms 2936 KB Output is partially correct - L* = 39
26 Partially correct 1112 ms 3056 KB Output is partially correct - L* = 38
27 Partially correct 1107 ms 3568 KB Output is partially correct - L* = 38
28 Partially correct 1113 ms 3312 KB Output is partially correct - L* = 38
29 Partially correct 1104 ms 3056 KB Output is partially correct - L* = 39
30 Partially correct 1116 ms 3312 KB Output is partially correct - L* = 39
31 Partially correct 1116 ms 3312 KB Output is partially correct - L* = 38
32 Partially correct 1105 ms 3056 KB Output is partially correct - L* = 37
33 Partially correct 1116 ms 3056 KB Output is partially correct - L* = 37
34 Partially correct 1115 ms 3056 KB Output is partially correct - L* = 37
35 Partially correct 1115 ms 3312 KB Output is partially correct - L* = 39
36 Partially correct 1115 ms 3056 KB Output is partially correct - L* = 39
37 Partially correct 1120 ms 3360 KB Output is partially correct - L* = 38
38 Partially correct 1122 ms 3144 KB Output is partially correct - L* = 38
39 Partially correct 1129 ms 3056 KB Output is partially correct - L* = 38
40 Partially correct 1113 ms 3320 KB Output is partially correct - L* = 38