Submission #132464

# Submission time Handle Problem Language Result Execution time Memory
132464 2019-07-18T23:11:26 Z mohammedehab2002 Broken Device (JOI17_broken_device) C++11
0 / 100
229 ms 3560 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
int 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[])
{
	for (int i=0;i<128;i++)
	mat[i].reset();
	mat[0][0]=1;
	for (int i=1;i<8;i++)
	{
		int len=(1<<(i-1));
		for (int j=0;j<len;j++)
		{
			for (int l=0;l<len;l++)
			{
				mat[j+len][l]=mat[j][l];
				mat[j][l+len]=mat[j][l];
			}
		}
	}
	mt19937 rng(12742127);
	shuffle(mat,mat+128,rng);
	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 len=(1<<(i-1));
		for (int j=0;j<len;j++)
		{
			for (int l=0;l<len;l++)
			{
				hmat[j+len][l]=hmat[j][l];
				hmat[j][l+len]=hmat[j][l];
			}
		}
	}
	mt19937 rng(12742127);
	shuffle(hmat,hmat+128,rng);
	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 220 ms 3312 KB Output isn't correct - L* = 0
2 Incorrect 220 ms 3312 KB Output isn't correct - L* = 0
3 Incorrect 219 ms 3312 KB Output isn't correct - L* = 0
4 Incorrect 223 ms 3312 KB Output isn't correct - L* = 0
5 Incorrect 222 ms 3312 KB Output isn't correct - L* = 0
6 Incorrect 220 ms 3320 KB Output isn't correct - L* = 0
7 Incorrect 223 ms 3312 KB Output isn't correct - L* = 0
8 Incorrect 222 ms 3312 KB Output isn't correct - L* = 0
9 Incorrect 220 ms 3352 KB Output isn't correct - L* = 0
10 Incorrect 229 ms 3312 KB Output isn't correct - L* = 0
11 Incorrect 223 ms 3144 KB Output isn't correct - L* = 0
12 Incorrect 223 ms 3056 KB Output isn't correct - L* = 0
13 Incorrect 220 ms 3312 KB Output isn't correct - L* = 0
14 Incorrect 220 ms 3272 KB Output isn't correct - L* = 0
15 Incorrect 220 ms 3312 KB Output isn't correct - L* = 0
16 Incorrect 220 ms 3312 KB Output isn't correct - L* = 0
17 Incorrect 219 ms 3312 KB Output isn't correct - L* = 0
18 Incorrect 222 ms 3312 KB Output isn't correct - L* = 0
19 Incorrect 220 ms 3312 KB Output isn't correct - L* = 0
20 Incorrect 222 ms 3560 KB Output isn't correct - L* = 0
21 Incorrect 221 ms 3344 KB Output isn't correct - L* = 0
22 Incorrect 219 ms 3312 KB Output isn't correct - L* = 0
23 Incorrect 221 ms 3312 KB Output isn't correct - L* = 0
24 Incorrect 220 ms 3312 KB Output isn't correct - L* = 0
25 Incorrect 220 ms 3312 KB Output isn't correct - L* = 0
26 Incorrect 219 ms 3328 KB Output isn't correct - L* = 0
27 Incorrect 221 ms 3416 KB Output isn't correct - L* = 0
28 Incorrect 220 ms 3408 KB Output isn't correct - L* = 0
29 Incorrect 220 ms 3312 KB Output isn't correct - L* = 0
30 Incorrect 222 ms 3096 KB Output isn't correct - L* = 0
31 Incorrect 220 ms 3176 KB Output isn't correct - L* = 0
32 Incorrect 221 ms 3312 KB Output isn't correct - L* = 0
33 Incorrect 223 ms 3312 KB Output isn't correct - L* = 0
34 Incorrect 221 ms 3312 KB Output isn't correct - L* = 0
35 Incorrect 221 ms 3160 KB Output isn't correct - L* = 0
36 Incorrect 220 ms 3312 KB Output isn't correct - L* = 0
37 Incorrect 223 ms 3312 KB Output isn't correct - L* = 0
38 Incorrect 226 ms 3312 KB Output isn't correct - L* = 0
39 Incorrect 226 ms 3312 KB Output isn't correct - L* = 0
40 Incorrect 225 ms 3384 KB Output isn't correct - L* = 0