답안 #99315

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
99315 2019-03-02T11:23:30 Z TadijaSebez Broken Device (JOI17_broken_device) C++11
0 / 100
66 ms 3584 KB
#include "Annalib.h"
#define ll long long
const int N=1050;
int ans[N];
void Anna(int n, ll x, int k, int p[])
{
	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;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 51 ms 3312 KB Output isn't correct - L* = 0
2 Incorrect 61 ms 3056 KB Output isn't correct - L* = 0
3 Incorrect 49 ms 3056 KB Output isn't correct - L* = 0
4 Incorrect 38 ms 3312 KB Output isn't correct - L* = 0
5 Incorrect 57 ms 3280 KB Output isn't correct - L* = 0
6 Incorrect 51 ms 3312 KB Output isn't correct - L* = 0
7 Incorrect 43 ms 3272 KB Output isn't correct - L* = 0
8 Incorrect 43 ms 3312 KB Output isn't correct - L* = 0
9 Incorrect 49 ms 3312 KB Output isn't correct - L* = 0
10 Incorrect 54 ms 3056 KB Output isn't correct - L* = 0
11 Incorrect 60 ms 3568 KB Output isn't correct - L* = 0
12 Incorrect 51 ms 3136 KB Output isn't correct - L* = 0
13 Incorrect 31 ms 3056 KB Output isn't correct - L* = 0
14 Incorrect 43 ms 3328 KB Output isn't correct - L* = 0
15 Incorrect 35 ms 3584 KB Output isn't correct - L* = 0
16 Incorrect 45 ms 3056 KB Output isn't correct - L* = 0
17 Incorrect 66 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 39 ms 3072 KB Output isn't correct - L* = 0
19 Incorrect 39 ms 3360 KB Output isn't correct - L* = 0
20 Incorrect 38 ms 3072 KB Output isn't correct - L* = 0
21 Incorrect 40 ms 3072 KB Output isn't correct - L* = 0
22 Incorrect 51 ms 3568 KB Output isn't correct - L* = 0
23 Incorrect 46 ms 3256 KB Output isn't correct - L* = 0
24 Incorrect 45 ms 3328 KB Output isn't correct - L* = 0
25 Incorrect 42 ms 3568 KB Output isn't correct - L* = 0
26 Incorrect 37 ms 3328 KB Output isn't correct - L* = 0
27 Incorrect 39 ms 3056 KB Output isn't correct - L* = 0
28 Incorrect 37 ms 3328 KB Output isn't correct - L* = 0
29 Incorrect 36 ms 3072 KB Output isn't correct - L* = 0
30 Incorrect 39 ms 3328 KB Output isn't correct - L* = 0
31 Incorrect 43 ms 3312 KB Output isn't correct - L* = 0
32 Incorrect 40 ms 3344 KB Output isn't correct - L* = 0
33 Incorrect 40 ms 3200 KB Output isn't correct - L* = 0
34 Incorrect 49 ms 3072 KB Output isn't correct - L* = 0
35 Incorrect 40 ms 3072 KB Output isn't correct - L* = 0
36 Incorrect 44 ms 3056 KB Output isn't correct - L* = 0
37 Incorrect 44 ms 3072 KB Output isn't correct - L* = 0
38 Incorrect 39 ms 3328 KB Output isn't correct - L* = 0
39 Incorrect 37 ms 3328 KB Output isn't correct - L* = 0
40 Incorrect 40 ms 3312 KB Output isn't correct - L* = 0