Submission #127991

# Submission time Handle Problem Language Result Execution time Memory
127991 2019-07-10T09:59:41 Z Utaha Broken Device (JOI17_broken_device) C++14
85 / 100
46 ms 3576 KB
#include "Annalib.h"
#include <bits/stdc++.h>
void Anna( int N, long long X, int K, int P[] ){
	X^=0x84d9302917c854LL;
	// std::cout<<X<<'\n';
	// for(long long i=X;i;i/=3) std::cout<<i%3;
	// std::cout<<'\n';
	bool ret[150]={0};
	bool notused[150]={0};
	for(int i=0;i<K;i++){
		notused[P[i]]=1;
	}
	int pt=38;
	for(int i=0;i<N;i+=2){
		long long type=X%3;
		if(type==0){
			if(notused[i]) continue;
			ret[i]=1;
			ret[i+1]=0;
		}
		else if(type==1){
			if(notused[i+1]) continue;
			ret[i]=0;
			ret[i+1]=1;
		}
		else{
			if(notused[i]||notused[i+1]) continue;
			ret[i]=ret[i+1]=1;
		}
		// std::cout<<X%3<<'\n';
		X/=3;
		pt--;
		if(pt==0) break;
	}
	// for(int i=0;i<N;i++) std::cout<<ret[i];
	// std::cout<<'\n';
	for(int i=0;i<N;i++) Set(i,ret[i]);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
long long Bruno( int N, int A[] ){
	long long ret=0;
	long long base=1;
	for(int i=0;i<N;i+=2){
		if(A[i]==0&&A[i+1]==0) continue;

		int type=-1;
		if(A[i]==1){
			if(A[i+1]==1) type=2;
			else type=0;
		}
		else type=1;

		// std::cout<<"Bruno: "<<type<<'\n';

		ret+=base*type;
		base*=3;
	}
	// std::cout<<ret<<'\n';
	return ret^0x84d9302917c854LL;
}
# Verdict Execution time Memory Grader output
1 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
2 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
3 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
4 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
5 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
6 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
7 Partially correct 41 ms 3312 KB Output is partially correct - L* = 37
8 Partially correct 41 ms 3312 KB Output is partially correct - L* = 37
9 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
10 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
11 Partially correct 41 ms 3312 KB Output is partially correct - L* = 37
12 Partially correct 41 ms 3312 KB Output is partially correct - L* = 37
13 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
14 Partially correct 40 ms 3248 KB Output is partially correct - L* = 37
15 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
16 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
17 Partially correct 46 ms 3312 KB Output is partially correct - L* = 37
18 Partially correct 39 ms 3568 KB Output is partially correct - L* = 37
19 Partially correct 43 ms 3312 KB Output is partially correct - L* = 37
20 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
21 Partially correct 40 ms 3568 KB Output is partially correct - L* = 37
22 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
23 Partially correct 39 ms 3312 KB Output is partially correct - L* = 37
24 Partially correct 41 ms 3312 KB Output is partially correct - L* = 37
25 Partially correct 41 ms 3312 KB Output is partially correct - L* = 37
26 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
27 Partially correct 40 ms 3256 KB Output is partially correct - L* = 37
28 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
29 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
30 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
31 Partially correct 40 ms 3208 KB Output is partially correct - L* = 37
32 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
33 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
34 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
35 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
36 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37
37 Partially correct 41 ms 3576 KB Output is partially correct - L* = 37
38 Partially correct 40 ms 3320 KB Output is partially correct - L* = 37
39 Partially correct 43 ms 3568 KB Output is partially correct - L* = 37
40 Partially correct 40 ms 3312 KB Output is partially correct - L* = 37