Submission #978282

# Submission time Handle Problem Language Result Execution time Memory
978282 2024-05-09T05:13:53 Z sleepntsheep Broken Device (JOI17_broken_device) C
0 / 100
260 ms 3404 KB
#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
1 Partially correct 213 ms 2828 KB Output isn't correct - L* = 0
2 Partially correct 213 ms 2680 KB Output isn't correct - L* = 0
3 Partially correct 215 ms 2656 KB Output isn't correct - L* = 0
4 Partially correct 210 ms 2624 KB Output isn't correct - L* = 0
5 Partially correct 217 ms 2632 KB Output isn't correct - L* = 0
6 Partially correct 216 ms 2616 KB Output isn't correct - L* = 0
7 Partially correct 213 ms 2680 KB Output isn't correct - L* = 0
8 Partially correct 221 ms 3404 KB Output isn't correct - L* = 0
9 Partially correct 233 ms 2588 KB Output isn't correct - L* = 0
10 Partially correct 212 ms 2628 KB Output isn't correct - L* = 0
11 Partially correct 219 ms 2640 KB Output isn't correct - L* = 0
12 Partially correct 213 ms 2780 KB Output isn't correct - L* = 0
13 Partially correct 214 ms 2780 KB Output isn't correct - L* = 0
14 Partially correct 254 ms 2568 KB Output isn't correct - L* = 0
15 Partially correct 212 ms 2656 KB Output isn't correct - L* = 0
16 Partially correct 216 ms 2760 KB Output isn't correct - L* = 0
17 Partially correct 217 ms 2632 KB Output isn't correct - L* = 0
18 Partially correct 229 ms 2644 KB Output isn't correct - L* = 0
19 Partially correct 232 ms 2536 KB Output isn't correct - L* = 0
20 Partially correct 212 ms 2680 KB Output isn't correct - L* = 0
21 Partially correct 214 ms 2660 KB Output isn't correct - L* = 0
22 Partially correct 215 ms 2524 KB Output isn't correct - L* = 0
23 Partially correct 220 ms 2672 KB Output isn't correct - L* = 0
24 Partially correct 225 ms 2676 KB Output isn't correct - L* = 0
25 Partially correct 260 ms 2692 KB Output isn't correct - L* = 0
26 Partially correct 215 ms 2760 KB Output isn't correct - L* = 0
27 Partially correct 213 ms 2680 KB Output isn't correct - L* = 0
28 Partially correct 212 ms 2736 KB Output isn't correct - L* = 0
29 Partially correct 228 ms 3000 KB Output isn't correct - L* = 0
30 Partially correct 212 ms 2684 KB Output isn't correct - L* = 0
31 Partially correct 215 ms 2912 KB Output isn't correct - L* = 0
32 Partially correct 213 ms 2680 KB Output isn't correct - L* = 0
33 Partially correct 251 ms 2936 KB Output isn't correct - L* = 0
34 Partially correct 213 ms 2772 KB Output isn't correct - L* = 0
35 Partially correct 225 ms 2680 KB Output isn't correct - L* = 0
36 Partially correct 219 ms 2764 KB Output isn't correct - L* = 0
37 Partially correct 218 ms 2756 KB Output isn't correct - L* = 0
38 Partially correct 215 ms 2672 KB Output isn't correct - L* = 0
39 Partially correct 214 ms 2616 KB Output isn't correct - L* = 0
40 Partially correct 211 ms 2676 KB Output isn't correct - L* = 0