Submission #1077156

# Submission time Handle Problem Language Result Execution time Memory
1077156 2024-08-27T01:58:01 Z LCJLY Broken Device (JOI17_broken_device) C++14
8 / 100
38 ms 2924 KB
#include "Annalib.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;

#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii; 

void Anna(int n, long long val, int k, int p[]){
	bool amos[155];
	memset(amos,0,sizeof(amos));
	for(int x=0;x<k;x++){
		amos[p[x]]=true;
	}
	
	vector<int>v;
	int bit=0;
	for(int x=0;x<60;x++){
		if(val&(1LL<<x)){
			v.push_back(1);
			bit++;
		}
		else v.push_back(0);
	}
	
	if(bit<=30){
		int ptr=0;
		for(int x=0;x<n;x++){
			if(ptr<(int)v.size()&&x!=n-1&&!amos[x]&&!amos[x+1]){
				Set(x,1);
				Set(x+1,v[ptr]);
				x++;
				ptr++;
			}
			else Set(x,0);
		}
	}
	else{
		for(int x=0;x<60;x++) v[x]=!v[x];
		int ptr=0;
		bool take=false;
		for(int x=0;x<n;x++){
			if(ptr<(int)v.size()&&x!=n-1&&!amos[x]){
				if(v[ptr]==0){
					Set(x,1);
					Set(x+1,0);
					ptr++;
					x++;
				}
				else if(v[ptr]==1&&!amos[x+1]){
					Set(x,1);
					Set(x+1,1);
					x++;
					ptr++;
				}
				else Set(x,0);
			}
			else if(ptr==(int)v.size()&&!take&&!amos[x]){
				take=true;
				Set(x,1);
			}
			else Set(x,0);
		}
	}
	
	
}
#include "Brunolib.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;

#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii; 

long long Bruno(int n, int a[]){
	long long val=0;
	int cur=0;
	//for(int x=0;x<n;x++) cout << a[x] << " ";
	//cout << endl;
	for(int x=0;x<n;x++){
		if(a[x]==1){
			if(a[x+1]==1){
				val+=1LL<<cur;
			}
			cur++;
			x++;
		}
	}
	//cout << "check" << endl;
	if(cur==61){
		val=(1LL<<60)-val-1;
	}
	return val;
}
# Verdict Execution time Memory Grader output
1 Partially correct 24 ms 2780 KB Output is partially correct - L* = 14
2 Partially correct 23 ms 2848 KB Output is partially correct - L* = 15
3 Partially correct 22 ms 2808 KB Output is partially correct - L* = 17
4 Partially correct 24 ms 2852 KB Output is partially correct - L* = 14
5 Partially correct 37 ms 2752 KB Output is partially correct - L* = 15
6 Partially correct 31 ms 2892 KB Output is partially correct - L* = 15
7 Partially correct 32 ms 2752 KB Output is partially correct - L* = 18
8 Partially correct 27 ms 2772 KB Output is partially correct - L* = 18
9 Partially correct 31 ms 2804 KB Output is partially correct - L* = 18
10 Partially correct 23 ms 2772 KB Output is partially correct - L* = 16
11 Partially correct 23 ms 2840 KB Output is partially correct - L* = 19
12 Partially correct 23 ms 2776 KB Output is partially correct - L* = 18
13 Partially correct 23 ms 2860 KB Output is partially correct - L* = 18
14 Partially correct 24 ms 2672 KB Output is partially correct - L* = 15
15 Partially correct 23 ms 2840 KB Output is partially correct - L* = 16
16 Partially correct 27 ms 2772 KB Output is partially correct - L* = 15
17 Partially correct 23 ms 2772 KB Output is partially correct - L* = 20
18 Partially correct 22 ms 2788 KB Output is partially correct - L* = 16
19 Partially correct 27 ms 2824 KB Output is partially correct - L* = 18
20 Partially correct 24 ms 2824 KB Output is partially correct - L* = 15
21 Partially correct 20 ms 2772 KB Output is partially correct - L* = 15
22 Partially correct 20 ms 2772 KB Output is partially correct - L* = 14
23 Partially correct 25 ms 2764 KB Output is partially correct - L* = 15
24 Partially correct 22 ms 2856 KB Output is partially correct - L* = 17
25 Partially correct 28 ms 2776 KB Output is partially correct - L* = 15
26 Partially correct 34 ms 2744 KB Output is partially correct - L* = 16
27 Partially correct 38 ms 2656 KB Output is partially correct - L* = 15
28 Partially correct 20 ms 2720 KB Output is partially correct - L* = 16
29 Partially correct 23 ms 2772 KB Output is partially correct - L* = 15
30 Partially correct 24 ms 2776 KB Output is partially correct - L* = 16
31 Partially correct 28 ms 2768 KB Output is partially correct - L* = 15
32 Partially correct 24 ms 2752 KB Output is partially correct - L* = 16
33 Partially correct 23 ms 2600 KB Output is partially correct - L* = 15
34 Partially correct 24 ms 2924 KB Output is partially correct - L* = 16
35 Partially correct 25 ms 2752 KB Output is partially correct - L* = 15
36 Partially correct 26 ms 2776 KB Output is partially correct - L* = 15
37 Partially correct 23 ms 2784 KB Output is partially correct - L* = 16
38 Partially correct 22 ms 2748 KB Output is partially correct - L* = 18
39 Partially correct 26 ms 2748 KB Output is partially correct - L* = 15
40 Partially correct 22 ms 2856 KB Output is partially correct - L* = 15