답안 #131713

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
131713 2019-07-17T13:18:41 Z mahmoudbadawy Broken Device (JOI17_broken_device) C++17
90 / 100
63 ms 3120 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

int br[155];

void Anna( int N, long long X, int K, int P[] ){
	srand(123321);
	vector<int> p;
	for(int i=0;i<N;i++) p.push_back(i);
	random_shuffle(p.begin(),p.end());
	for(int i=0;i<N;i++) br[i]=0;
	for(int i=0;i<K;i++) br[P[i]]=1;
	for(int i=0;i<N;i+=2)
	{
		if(br[p[i]]||br[p[i+1]])
			br[p[i]]=br[p[i+1]]=1;
	}
	for(int i=0;i<N;i+=2)
	{
		if(br[p[i]]) {Set(p[i],0); Set(p[i+1],0); continue;}
		int b=X%3; X/=3;
		if(b==0) {Set(p[i],0); Set(p[i+1],1);}
		else if(b==1) {Set(p[i],1); Set(p[i+1],0);}
		else {Set(p[i],1); Set(p[i+1],1);}
	}
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;

long long Bruno( int N, int A[] ){
	srand(123321);
	vector<int> p;
	for(int i=0;i<N;i++) p.push_back(i);
	random_shuffle(p.begin(),p.end());
	vector<int> v;
	for(int i=0;i<N;i+=2)
	{
		if(A[p[i]]+A[p[i+1]]==0) continue;
		if(A[p[i]]==0&&A[p[i+1]]==1) v.push_back(0);
		else if(A[p[i]]==1&&A[p[i+1]]==0) v.push_back(1);
		else v.push_back(2);
	}
	long long x=0;
	for(int i=v.size()-1;i>=0;i--){x*=3; x+=v[i];}
	return x;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
2 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
3 Partially correct 56 ms 2960 KB Output is partially correct - L* = 39
4 Partially correct 56 ms 3056 KB Output is partially correct - L* = 39
5 Partially correct 56 ms 3048 KB Output is partially correct - L* = 39
6 Partially correct 56 ms 3048 KB Output is partially correct - L* = 39
7 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
8 Partially correct 56 ms 3056 KB Output is partially correct - L* = 39
9 Partially correct 56 ms 3056 KB Output is partially correct - L* = 39
10 Partially correct 56 ms 3056 KB Output is partially correct - L* = 39
11 Partially correct 56 ms 3056 KB Output is partially correct - L* = 39
12 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
13 Partially correct 57 ms 3056 KB Output is partially correct - L* = 39
14 Partially correct 59 ms 3064 KB Output is partially correct - L* = 38
15 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
16 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
17 Partially correct 60 ms 3056 KB Output is partially correct - L* = 38
18 Partially correct 59 ms 3056 KB Output is partially correct - L* = 39
19 Partially correct 63 ms 3056 KB Output is partially correct - L* = 39
20 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
21 Partially correct 56 ms 3000 KB Output is partially correct - L* = 39
22 Partially correct 56 ms 3120 KB Output is partially correct - L* = 38
23 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
24 Partially correct 59 ms 3016 KB Output is partially correct - L* = 38
25 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
26 Partially correct 56 ms 3056 KB Output is partially correct - L* = 39
27 Partially correct 59 ms 3056 KB Output is partially correct - L* = 39
28 Partially correct 57 ms 3056 KB Output is partially correct - L* = 39
29 Partially correct 56 ms 2800 KB Output is partially correct - L* = 39
30 Partially correct 59 ms 3056 KB Output is partially correct - L* = 38
31 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
32 Partially correct 59 ms 3056 KB Output is partially correct - L* = 39
33 Partially correct 57 ms 3056 KB Output is partially correct - L* = 39
34 Partially correct 61 ms 3056 KB Output is partially correct - L* = 39
35 Partially correct 57 ms 3056 KB Output is partially correct - L* = 38
36 Partially correct 62 ms 3064 KB Output is partially correct - L* = 39
37 Partially correct 60 ms 3040 KB Output is partially correct - L* = 39
38 Partially correct 56 ms 3056 KB Output is partially correct - L* = 39
39 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38
40 Partially correct 56 ms 3056 KB Output is partially correct - L* = 38