Submission #127999

# Submission time Handle Problem Language Result Execution time Memory
127999 2019-07-10T10:13:35 Z Utaha Broken Device (JOI17_broken_device) C++14
0 / 100
133 ms 4256 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
int partner[150];
vector<int> s;

void Anna( int N, long long X, int K, int P[] ){
	srand(123987654);

	vector<int> v;
	for(int i=0;i<150;i++) v.pb(i);
	random_shuffle(v.begin(),v.end());
	for(int i=0;i<150;i+=2){
		partner[v[i]]=v[i+1];
		partner[v[i+1]]=v[i];
		s.pb(v[i]);
	}

	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:s){
		long long type=X%3;
		if(type==0){
			if(notused[i]) continue;
			ret[i]=1;
			ret[partner[i]]=0;
		}
		else if(type==1){
			if(notused[partner[i]]) continue;
			ret[i]=0;
			ret[partner[i]]=1;
		}
		else{
			if(notused[i]||notused[partner[i]]) continue;
			ret[i]=ret[partner[i]]=1;
		}
		// std::cout<<X%3<<'\n';
		X/=3;
		if(X==0) break;
		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>
using namespace std;
#define pb push_back
vector<int> s2;
int partner2[150];
long long Bruno( int N, int A[] ){
	srand(123987654);

	vector<int> v;
	for(int i=0;i<150;i++) v.pb(i);
	random_shuffle(v.begin(),v.end());
	for(int i=0;i<150;i+=2){
		partner2[v[i]]=v[i+1];
		partner2[v[i+1]]=v[i];
		s2.pb(v[i]);
	}

	long long ret=0;
	long long base=1;
	for(int i:s2){
		if(A[i]==0&&A[partner2[i]]==0) continue;

		int type=-1;
		if(A[i]==1){
			if(A[partner2[i]]==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 Incorrect 115 ms 3808 KB Output isn't correct - L* = 0
2 Incorrect 115 ms 3752 KB Output isn't correct - L* = 0
3 Incorrect 115 ms 3808 KB Output isn't correct - L* = 0
4 Incorrect 114 ms 3808 KB Output isn't correct - L* = 0
5 Incorrect 119 ms 3808 KB Output isn't correct - L* = 0
6 Incorrect 116 ms 3888 KB Output isn't correct - L* = 0
7 Incorrect 119 ms 3808 KB Output isn't correct - L* = 0
8 Incorrect 115 ms 3752 KB Output isn't correct - L* = 0
9 Incorrect 115 ms 3968 KB Output isn't correct - L* = 0
10 Incorrect 115 ms 3808 KB Output isn't correct - L* = 0
11 Incorrect 115 ms 4256 KB Output isn't correct - L* = 0
12 Incorrect 114 ms 3808 KB Output isn't correct - L* = 0
13 Incorrect 115 ms 3856 KB Output isn't correct - L* = 0
14 Incorrect 115 ms 3696 KB Output isn't correct - L* = 0
15 Incorrect 114 ms 3776 KB Output isn't correct - L* = 0
16 Incorrect 115 ms 3928 KB Output isn't correct - L* = 0
17 Incorrect 115 ms 3808 KB Output isn't correct - L* = 0
18 Incorrect 118 ms 3808 KB Output isn't correct - L* = 0
19 Incorrect 114 ms 3816 KB Output isn't correct - L* = 0
20 Incorrect 117 ms 3944 KB Output isn't correct - L* = 0
21 Incorrect 115 ms 3928 KB Output isn't correct - L* = 0
22 Incorrect 114 ms 3808 KB Output isn't correct - L* = 0
23 Incorrect 115 ms 3880 KB Output isn't correct - L* = 0
24 Incorrect 115 ms 3976 KB Output isn't correct - L* = 0
25 Incorrect 119 ms 3800 KB Output isn't correct - L* = 0
26 Incorrect 114 ms 3752 KB Output isn't correct - L* = 0
27 Incorrect 114 ms 3808 KB Output isn't correct - L* = 0
28 Incorrect 115 ms 3808 KB Output isn't correct - L* = 0
29 Incorrect 115 ms 3808 KB Output isn't correct - L* = 0
30 Incorrect 115 ms 3744 KB Output isn't correct - L* = 0
31 Incorrect 115 ms 3808 KB Output isn't correct - L* = 0
32 Incorrect 117 ms 3792 KB Output isn't correct - L* = 0
33 Incorrect 118 ms 3800 KB Output isn't correct - L* = 0
34 Incorrect 115 ms 4080 KB Output isn't correct - L* = 0
35 Incorrect 115 ms 3808 KB Output isn't correct - L* = 0
36 Incorrect 114 ms 3912 KB Output isn't correct - L* = 0
37 Incorrect 114 ms 4088 KB Output isn't correct - L* = 0
38 Incorrect 115 ms 3800 KB Output isn't correct - L* = 0
39 Incorrect 133 ms 3808 KB Output isn't correct - L* = 0
40 Incorrect 115 ms 3800 KB Output isn't correct - L* = 0