Submission #131663

# Submission time Handle Problem Language Result Execution time Memory
131663 2019-07-17T12:13:44 Z mohammedehab2002 Broken Device (JOI17_broken_device) C++11
8 / 100
212 ms 3312 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];
			}
		}
	}
	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];
			}
		}
	}
	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 Partially correct 200 ms 3056 KB Output is partially correct - L* = 15
2 Partially correct 198 ms 3056 KB Output is partially correct - L* = 17
3 Partially correct 204 ms 3056 KB Output is partially correct - L* = 18
4 Partially correct 212 ms 3312 KB Output is partially correct - L* = 21
5 Partially correct 200 ms 2864 KB Output is partially correct - L* = 22
6 Partially correct 200 ms 3256 KB Output is partially correct - L* = 16
7 Partially correct 199 ms 3056 KB Output is partially correct - L* = 19
8 Partially correct 199 ms 3056 KB Output is partially correct - L* = 15
9 Partially correct 199 ms 2976 KB Output is partially correct - L* = 23
10 Partially correct 200 ms 3312 KB Output is partially correct - L* = 16
11 Partially correct 200 ms 2880 KB Output is partially correct - L* = 17
12 Partially correct 198 ms 3112 KB Output is partially correct - L* = 14
13 Partially correct 199 ms 2872 KB Output is partially correct - L* = 19
14 Partially correct 200 ms 3056 KB Output is partially correct - L* = 15
15 Partially correct 198 ms 3040 KB Output is partially correct - L* = 21
16 Partially correct 200 ms 3056 KB Output is partially correct - L* = 17
17 Partially correct 199 ms 3056 KB Output is partially correct - L* = 20
18 Partially correct 199 ms 3000 KB Output is partially correct - L* = 20
19 Partially correct 199 ms 3056 KB Output is partially correct - L* = 20
20 Partially correct 200 ms 3056 KB Output is partially correct - L* = 22
21 Partially correct 199 ms 3312 KB Output is partially correct - L* = 21
22 Partially correct 199 ms 3056 KB Output is partially correct - L* = 15
23 Partially correct 199 ms 3056 KB Output is partially correct - L* = 21
24 Partially correct 198 ms 3056 KB Output is partially correct - L* = 17
25 Partially correct 199 ms 3192 KB Output is partially correct - L* = 15
26 Partially correct 201 ms 3056 KB Output is partially correct - L* = 17
27 Partially correct 199 ms 3056 KB Output is partially correct - L* = 17
28 Partially correct 204 ms 2896 KB Output is partially correct - L* = 20
29 Partially correct 200 ms 3056 KB Output is partially correct - L* = 17
30 Partially correct 208 ms 2856 KB Output is partially correct - L* = 21
31 Partially correct 209 ms 2800 KB Output is partially correct - L* = 23
32 Partially correct 209 ms 3288 KB Output is partially correct - L* = 17
33 Partially correct 199 ms 3256 KB Output is partially correct - L* = 17
34 Partially correct 204 ms 3096 KB Output is partially correct - L* = 26
35 Partially correct 199 ms 3056 KB Output is partially correct - L* = 26
36 Partially correct 201 ms 3288 KB Output is partially correct - L* = 16
37 Partially correct 199 ms 2984 KB Output is partially correct - L* = 17
38 Partially correct 199 ms 3056 KB Output is partially correct - L* = 17
39 Partially correct 199 ms 2928 KB Output is partially correct - L* = 15
40 Partially correct 199 ms 2992 KB Output is partially correct - L* = 17