Submission #127996

# Submission time Handle Problem Language Result Execution time Memory
127996 2019-07-10T10:12:17 Z Utaha Broken Device (JOI17_broken_device) C++14
0 / 100
40 ms 4072 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 partner[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){
		partner[v[i]]=v[i+1];
		partner[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[partner[i]]==0) continue;

		int type=-1;
		if(A[i]==1){
			if(A[partner[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 38 ms 4064 KB Unexpected end of file - int64 expected
2 Incorrect 37 ms 3800 KB Unexpected end of file - int64 expected
3 Incorrect 35 ms 3808 KB Unexpected end of file - int64 expected
4 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
5 Incorrect 37 ms 4064 KB Unexpected end of file - int64 expected
6 Incorrect 35 ms 4072 KB Unexpected end of file - int64 expected
7 Incorrect 35 ms 3808 KB Unexpected end of file - int64 expected
8 Incorrect 35 ms 3816 KB Unexpected end of file - int64 expected
9 Incorrect 35 ms 3808 KB Unexpected end of file - int64 expected
10 Incorrect 35 ms 3856 KB Unexpected end of file - int64 expected
11 Incorrect 37 ms 4064 KB Unexpected end of file - int64 expected
12 Incorrect 37 ms 3800 KB Unexpected end of file - int64 expected
13 Incorrect 36 ms 4064 KB Unexpected end of file - int64 expected
14 Incorrect 40 ms 3808 KB Unexpected end of file - int64 expected
15 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
16 Incorrect 35 ms 3976 KB Unexpected end of file - int64 expected
17 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
18 Incorrect 35 ms 3808 KB Unexpected end of file - int64 expected
19 Incorrect 37 ms 3936 KB Unexpected end of file - int64 expected
20 Incorrect 35 ms 3896 KB Unexpected end of file - int64 expected
21 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
22 Incorrect 35 ms 3800 KB Unexpected end of file - int64 expected
23 Incorrect 36 ms 4064 KB Unexpected end of file - int64 expected
24 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
25 Incorrect 35 ms 3808 KB Unexpected end of file - int64 expected
26 Incorrect 35 ms 4056 KB Unexpected end of file - int64 expected
27 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
28 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
29 Incorrect 34 ms 4064 KB Unexpected end of file - int64 expected
30 Incorrect 35 ms 4008 KB Unexpected end of file - int64 expected
31 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
32 Incorrect 36 ms 3808 KB Unexpected end of file - int64 expected
33 Incorrect 35 ms 3832 KB Unexpected end of file - int64 expected
34 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
35 Incorrect 35 ms 4064 KB Unexpected end of file - int64 expected
36 Incorrect 35 ms 4008 KB Unexpected end of file - int64 expected
37 Incorrect 37 ms 3800 KB Unexpected end of file - int64 expected
38 Incorrect 35 ms 3808 KB Unexpected end of file - int64 expected
39 Incorrect 35 ms 3808 KB Unexpected end of file - int64 expected
40 Incorrect 35 ms 3808 KB Unexpected end of file - int64 expected