Submission #978266

# Submission time Handle Problem Language Result Execution time Memory
978266 2024-05-09T05:03:14 Z sleepntsheep Broken Device (JOI17_broken_device) C
0 / 100
75 ms 2672 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(); }

u64 basis[64];
u64 basis_subtract[64][64], bo[64];

void basis_add(u64 x,int id)
{
    u64 sub[64], so=0;
    for(int j=60;j>=0;--j)
    {
        if(0==((x>>j)&1))
            continue;
        if (basis[j])
            x ^= vecspace[sub[so++] = basis[j]];
        else
        {
            sub[so++] = id;
            basis[j] = id;
            bo[j] = so;
            memcpy(basis_subtract[j], sub, sizeof *sub * so);
        }
    }
}

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;

    for(int i=0;i<64;++i)basis[i]=0;
    for(int i=0;i<150;++i)
    {
        if(skillissue[i])continue;
        basis_add(vecspace[i], i);
    }

    int encoded[150]={0};

    for(int j=60;j>=0;--j)
    {
        if(0==((X>>j)&1))
            continue;

        for(u64 i=0;i<bo[j];++i)
            encoded[basis_subtract[j][i]] ^= 1;
    }

    for(int i=0;i<150;++i)
        Set(i, encoded[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 75 ms 2672 KB Output isn't correct - L* = 0
2 Partially correct 61 ms 2488 KB Output isn't correct - L* = 0
3 Partially correct 63 ms 2560 KB Output isn't correct - L* = 0
4 Partially correct 60 ms 2360 KB Output isn't correct - L* = 0
5 Partially correct 59 ms 2380 KB Output isn't correct - L* = 0
6 Partially correct 60 ms 2304 KB Output isn't correct - L* = 0
7 Partially correct 60 ms 2520 KB Output isn't correct - L* = 0
8 Partially correct 63 ms 2464 KB Output isn't correct - L* = 0
9 Partially correct 60 ms 2360 KB Output isn't correct - L* = 0
10 Partially correct 61 ms 2380 KB Output isn't correct - L* = 0
11 Partially correct 60 ms 2604 KB Output isn't correct - L* = 0
12 Partially correct 59 ms 2372 KB Output isn't correct - L* = 0
13 Partially correct 64 ms 2468 KB Output isn't correct - L* = 0
14 Partially correct 61 ms 2372 KB Output isn't correct - L* = 0
15 Partially correct 60 ms 2440 KB Output isn't correct - L* = 0
16 Partially correct 60 ms 2420 KB Output isn't correct - L* = 0
17 Partially correct 60 ms 2484 KB Output isn't correct - L* = 0
18 Partially correct 60 ms 2360 KB Output isn't correct - L* = 0
19 Partially correct 61 ms 2612 KB Output isn't correct - L* = 0
20 Partially correct 61 ms 2344 KB Output isn't correct - L* = 0
21 Partially correct 59 ms 2588 KB Output isn't correct - L* = 0
22 Partially correct 67 ms 2560 KB Output isn't correct - L* = 0
23 Partially correct 60 ms 2300 KB Output isn't correct - L* = 0
24 Partially correct 61 ms 2356 KB Output isn't correct - L* = 0
25 Partially correct 60 ms 2316 KB Output isn't correct - L* = 0
26 Partially correct 66 ms 2456 KB Output isn't correct - L* = 0
27 Partially correct 62 ms 2536 KB Output isn't correct - L* = 0
28 Partially correct 60 ms 2300 KB Output isn't correct - L* = 0
29 Partially correct 60 ms 2360 KB Output isn't correct - L* = 0
30 Partially correct 60 ms 2360 KB Output isn't correct - L* = 0
31 Partially correct 61 ms 2300 KB Output isn't correct - L* = 0
32 Partially correct 61 ms 2308 KB Output isn't correct - L* = 0
33 Partially correct 61 ms 2612 KB Output isn't correct - L* = 0
34 Partially correct 61 ms 2396 KB Output isn't correct - L* = 0
35 Partially correct 60 ms 2300 KB Output isn't correct - L* = 0
36 Partially correct 61 ms 2360 KB Output isn't correct - L* = 0
37 Partially correct 61 ms 2360 KB Output isn't correct - L* = 0
38 Partially correct 62 ms 2524 KB Output isn't correct - L* = 0
39 Partially correct 63 ms 2304 KB Output isn't correct - L* = 0
40 Partially correct 60 ms 2392 KB Output isn't correct - L* = 0