Submission #131655

# Submission time Handle Problem Language Result Execution time Memory
131655 2019-07-17T11:43:29 Z mohammedehab2002 Broken Device (JOI17_broken_device) C++11
0 / 100
220 ms 3568 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
int n,ans[155],pos[128];
bitset<129> mat[128],bas[128];
void add(int r)
{
	for (int i=0;i<128;i++)
	{
		if (mat[r][i])
		mat[r]^=bas[i];
	}
	for (int i=0;i<128;i++)
	{
		if (mat[r][i])
		{
			bas[i]=mat[r];
			pos[r]=i;
			return;
		}
	}
}
void Anna(int n,long long x,int k,int p[])
{
	mat[0][0]=1;
	for (int i=1;i<8;i++)
	{
		int k=(1<<(i-1));
		for (int j=0;j<k;j++)
		{
			for (int l=0;l<k;l++)
			{
				mat[j+k][l]=mat[j][l];
				mat[j][l+k]=mat[j][l];
			}
		}
	}
	for (int i=0;i<128;i++)
	{
		bas[i].reset();
		for (int j=0;j<k;j++)
		mat[i][p[j]]=0;
	}
	memset(pos,-1,sizeof(pos));
	memset(ans,-1,sizeof(ans));
	for (int i=0;i<128;i++)
	{
		if (i<60)
		{
			bool b=(x&(1LL<<i));
			mat[i][128]=b;
		}
		else
		mat[i][128]=0;
		add(i);
	}
	for (int i=127;i>=0;i--)
	{
		if (pos[i]==-1)
		continue;
		for (int j=0;j<i;j++)
		{
			if (mat[j][pos[i]])
			mat[j]^=mat[i];
		}
	}
	for (int i=0;i<128;i++)
	{
		if (pos[i]!=-1)
		ans[pos[i]]=mat[i][128];
	}
	for (int i=0;i<n;i++)
	{
		if (ans[i]==-1)
		ans[i]=0;
		Set(i,ans[i]);
	}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
bitset<128> hmat[128];
long long Bruno(int n,int a[])
{
	hmat[0][0]=1;
	for (int i=1;i<8;i++)
	{
		int k=(1<<(i-1));
		for (int j=0;j<k;j++)
		{
			for (int l=0;l<k;l++)
			{
				hmat[j+k][l]=hmat[j][l];
				hmat[j][l+k]=hmat[j][l];
			}
		}
	}
	long long x=0;
	for (int i=0;i<60;i++)
	{
		long long cur=0;
		for (int j=0;j<n;j++)
		{
			if (hmat[i][j])
			cur^=a[j];
		}
		x|=(cur<<i);
	}
	return x;
}
# Verdict Execution time Memory Grader output
1 Incorrect 214 ms 3328 KB Output isn't correct - L* = 0
2 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
3 Incorrect 213 ms 3360 KB Output isn't correct - L* = 0
4 Incorrect 214 ms 3360 KB Output isn't correct - L* = 0
5 Incorrect 214 ms 3312 KB Output isn't correct - L* = 0
6 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
7 Incorrect 215 ms 3560 KB Output isn't correct - L* = 0
8 Incorrect 213 ms 3320 KB Output isn't correct - L* = 0
9 Incorrect 215 ms 3416 KB Output isn't correct - L* = 0
10 Incorrect 219 ms 3328 KB Output isn't correct - L* = 0
11 Incorrect 214 ms 3312 KB Output isn't correct - L* = 0
12 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
13 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
14 Incorrect 214 ms 3152 KB Output isn't correct - L* = 0
15 Incorrect 213 ms 3568 KB Output isn't correct - L* = 0
16 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
17 Incorrect 214 ms 3376 KB Output isn't correct - L* = 0
18 Incorrect 216 ms 3280 KB Output isn't correct - L* = 0
19 Incorrect 215 ms 3312 KB Output isn't correct - L* = 0
20 Incorrect 214 ms 3256 KB Output isn't correct - L* = 0
21 Incorrect 214 ms 3312 KB Output isn't correct - L* = 0
22 Incorrect 215 ms 3448 KB Output isn't correct - L* = 0
23 Incorrect 214 ms 3464 KB Output isn't correct - L* = 0
24 Incorrect 214 ms 3312 KB Output isn't correct - L* = 0
25 Incorrect 216 ms 3408 KB Output isn't correct - L* = 0
26 Incorrect 215 ms 3312 KB Output isn't correct - L* = 0
27 Incorrect 215 ms 3128 KB Output isn't correct - L* = 0
28 Incorrect 214 ms 3312 KB Output isn't correct - L* = 0
29 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
30 Incorrect 217 ms 3312 KB Output isn't correct - L* = 0
31 Incorrect 214 ms 3256 KB Output isn't correct - L* = 0
32 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
33 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
34 Incorrect 220 ms 3256 KB Output isn't correct - L* = 0
35 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
36 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
37 Incorrect 214 ms 3312 KB Output isn't correct - L* = 0
38 Incorrect 213 ms 3312 KB Output isn't correct - L* = 0
39 Incorrect 216 ms 3312 KB Output isn't correct - L* = 0
40 Incorrect 213 ms 3384 KB Output isn't correct - L* = 0