Submission #978259

# Submission time Handle Problem Language Result Execution time Memory
978259 2024-05-09T04:58:45 Z sleepntsheep Broken Device (JOI17_broken_device) C
0 / 100
1 ms 604 KB
#include "Annalib.h"
#include<string.h>
#include<stdlib.h>

typedef unsigned long long u64;
u64 vecspace[150];
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(u64 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(u64 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>

unsigned long long vecspace[150];
void init() { for(int i=0;i<150;++i) vecspace[i]=rand()*1llu*rand(); }

long long Bruno( int N, int A[] ){
    srand(86868686u);

    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 Runtime error 1 ms 348 KB Execution killed with signal 11
2 Runtime error 1 ms 344 KB Execution killed with signal 11
3 Runtime error 1 ms 348 KB Execution killed with signal 11
4 Runtime error 1 ms 436 KB Execution killed with signal 11
5 Runtime error 1 ms 348 KB Execution killed with signal 11
6 Runtime error 1 ms 348 KB Execution killed with signal 11
7 Runtime error 0 ms 348 KB Execution killed with signal 11
8 Runtime error 1 ms 348 KB Execution killed with signal 11
9 Runtime error 0 ms 348 KB Execution killed with signal 11
10 Runtime error 1 ms 348 KB Execution killed with signal 11
11 Runtime error 0 ms 348 KB Execution killed with signal 11
12 Runtime error 0 ms 348 KB Execution killed with signal 11
13 Runtime error 1 ms 348 KB Execution killed with signal 11
14 Runtime error 1 ms 504 KB Execution killed with signal 11
15 Runtime error 0 ms 432 KB Execution killed with signal 11
16 Runtime error 1 ms 348 KB Execution killed with signal 11
17 Runtime error 0 ms 432 KB Execution killed with signal 11
18 Runtime error 0 ms 348 KB Execution killed with signal 11
19 Runtime error 1 ms 348 KB Execution killed with signal 11
20 Runtime error 0 ms 352 KB Execution killed with signal 11
21 Runtime error 0 ms 348 KB Execution killed with signal 11
22 Runtime error 1 ms 348 KB Execution killed with signal 11
23 Runtime error 0 ms 348 KB Execution killed with signal 11
24 Runtime error 0 ms 432 KB Execution killed with signal 11
25 Runtime error 1 ms 344 KB Execution killed with signal 11
26 Runtime error 1 ms 348 KB Execution killed with signal 11
27 Runtime error 1 ms 348 KB Execution killed with signal 11
28 Runtime error 1 ms 348 KB Execution killed with signal 11
29 Runtime error 1 ms 348 KB Execution killed with signal 11
30 Runtime error 1 ms 348 KB Execution killed with signal 11
31 Runtime error 1 ms 348 KB Execution killed with signal 11
32 Runtime error 0 ms 348 KB Execution killed with signal 11
33 Runtime error 0 ms 348 KB Execution killed with signal 11
34 Runtime error 1 ms 348 KB Execution killed with signal 11
35 Runtime error 1 ms 348 KB Execution killed with signal 11
36 Runtime error 1 ms 348 KB Execution killed with signal 11
37 Runtime error 1 ms 348 KB Execution killed with signal 11
38 Runtime error 0 ms 432 KB Execution killed with signal 11
39 Runtime error 1 ms 604 KB Execution killed with signal 11
40 Runtime error 1 ms 348 KB Execution killed with signal 11