Submission #99316

# Submission time Handle Problem Language Result Execution time Memory
99316 2019-03-02T11:28:35 Z TadijaSebez Broken Device (JOI17_broken_device) C++11
0 / 100
70 ms 3312 KB
#include "Annalib.h"
#define ll long long
const int N=1050;
int ans[N],p[N];
void Anna(int n, ll x, int k, int q[])
{
	for(int i=0;i<n;i++) ans[i]=p[i]=0;
	for(int i=0;i<k;i++) p[q[i]]=1;
	for(int i=0;i+2<n;i+=3)
	{
		if(p[i]+p[i+1]+p[i+2]>=2) continue;
		if(p[i])
		{
			if(x%2==0) ans[i+1]=ans[i+2]=1;
			if(x%2==1) ans[i+2]=1;
			x/=2;
		}
		else if(p[i+1])
		{
			if(x%2==0) ans[i]=1;
			if(x%2==1) ans[i+2]=1;
			x/=2;
		}
		else if(p[i+2])
		{
			if(x%2==0) ans[i]=1;
			if(x%4==1) ans[i+1]=1;
			if(x%4==3) ans[i]=ans[i+1]=1;
			if(x%2==0) x/=2;
			else x/=4;
		}
		else
		{
			if(x%4==0) ans[i]=ans[i+1]=ans[i+2]=1;
			if(x%4==1) ans[i+1]=1;
			if(x%4==2) ans[i]=ans[i+2]=1;
			if(x%4==3) ans[i]=ans[i+1]=1;
			x/=4;
		}
	}
	for(int i=0;i<n;i++) Set(i,ans[i]);
}
#include "Brunolib.h"
#define ll long long
ll Bruno(int n, int ans[])
{
	ll x=0;
	for(int i=0;i+2<n;i+=3)
	{
		int tmp=4*ans[i]+2*ans[i+1]+ans[i+2];
		if(tmp==1) x*=2,x++;
		if(tmp==2) x*=4,x++;
		if(tmp==3) x*=2;
		if(tmp==4) x*=2;
		if(tmp==5) x*=4,x+=2;
		if(tmp==6) x*=4,x+=3;
		if(tmp==7) x*=4;
	}
	return x;
}
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 3056 KB Output isn't correct - L* = 0
2 Incorrect 39 ms 3312 KB Output isn't correct - L* = 0
3 Incorrect 43 ms 2816 KB Output isn't correct - L* = 0
4 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
5 Incorrect 38 ms 3072 KB Output isn't correct - L* = 0
6 Incorrect 38 ms 2816 KB Output isn't correct - L* = 0
7 Incorrect 57 ms 3072 KB Output isn't correct - L* = 0
8 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
9 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
10 Incorrect 55 ms 3072 KB Output isn't correct - L* = 0
11 Incorrect 62 ms 2816 KB Output isn't correct - L* = 0
12 Incorrect 39 ms 2816 KB Output isn't correct - L* = 0
13 Incorrect 40 ms 3072 KB Output isn't correct - L* = 0
14 Incorrect 65 ms 2800 KB Output isn't correct - L* = 0
15 Incorrect 70 ms 2944 KB Output isn't correct - L* = 0
16 Incorrect 57 ms 3056 KB Output isn't correct - L* = 0
17 Incorrect 37 ms 3128 KB Output isn't correct - L* = 0
18 Incorrect 39 ms 3104 KB Output isn't correct - L* = 0
19 Incorrect 53 ms 2928 KB Output isn't correct - L* = 0
20 Incorrect 40 ms 2816 KB Output isn't correct - L* = 0
21 Incorrect 39 ms 3000 KB Output isn't correct - L* = 0
22 Incorrect 37 ms 3016 KB Output isn't correct - L* = 0
23 Incorrect 41 ms 3200 KB Output isn't correct - L* = 0
24 Incorrect 35 ms 2816 KB Output isn't correct - L* = 0
25 Incorrect 38 ms 2816 KB Output isn't correct - L* = 0
26 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
27 Incorrect 45 ms 3056 KB Output isn't correct - L* = 0
28 Incorrect 46 ms 3056 KB Output isn't correct - L* = 0
29 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
30 Incorrect 40 ms 2816 KB Output isn't correct - L* = 0
31 Incorrect 39 ms 3000 KB Output isn't correct - L* = 0
32 Incorrect 51 ms 3072 KB Output isn't correct - L* = 0
33 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
34 Incorrect 49 ms 3072 KB Output isn't correct - L* = 0
35 Incorrect 39 ms 2816 KB Output isn't correct - L* = 0
36 Incorrect 41 ms 2800 KB Output isn't correct - L* = 0
37 Incorrect 40 ms 3048 KB Output isn't correct - L* = 0
38 Incorrect 57 ms 2816 KB Output isn't correct - L* = 0
39 Incorrect 40 ms 2800 KB Output isn't correct - L* = 0
40 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0