# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
978282 | sleepntsheep | Broken Device (JOI17_broken_device) | C11 | 260 ms | 3404 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Annalib.h"
#include<string.h>
#include<stdlib.h>
typedef unsigned long long u64;
static u64 vecspace[150];
static void init() { for(int i=0;i<150;++i) vecspace[i]=rand()*1llu*rand()*1llu*rand(); }
u64 basis[64];
int basis_toggle[64][110];
int map[150], rvmap[110];
void basis_add(u64 x,int id)
{
int toggle[110]={0};
toggle[id] = 1;
for(int j=60;j>=0;--j)
{
if(0==((x>>j)&1))
continue;
if (basis[j])
{
for (int k=0;k<110;++k)
toggle[k] ^= basis_toggle[j][k];
x ^= basis[j];
}
else
{
basis[j] = x;
memcpy(basis_toggle[j], toggle, sizeof toggle);
}
}
}
void Anna( int N, long long X, int K, int P[] ){
srand(86868686u);
init();
int skillissue[150]={0};
for(int i=0;i<K;++i)skillissue[P[i]]=1;
int c1=0;
for(int i=0;i<150;++i)
{
if(skillissue[i]==0)map[i]=c1,rvmap[c1]=i,++c1;
}
for(int i=0;i<64;++i)basis[i]=0;
for(int i=0;i<150;++i)
{
if(map[i]>=110)continue;
if(skillissue[i])continue;
basis_add(vecspace[i], map[i]);
}
int encode[150]={0};
for(int j=60;j>=0;--j)
{
if(0==((X>>j)&1))
continue;
X ^= basis[j];
for(int k=0;k<110;++k)
encode[rvmap[k]] ^= basis_toggle[j][k];
}
for(int i=0;i<150;++i) Set(i,encode[i]);
}
#include "Brunolib.h"
#include<stdlib.h>
static unsigned long long vecspace[150];
static void init() { for(int i=0;i<150;++i) vecspace[i]=rand()*1llu*rand(); }
long long Bruno( int N, int A[] ){
srand(86868686u);
init();
unsigned long long X=0;
for(int i=0;i<150;++i)
if(A[i]) X^=vecspace[i];
return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |