답안 #978264

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
978264 2024-05-09T05:02:47 Z sleepntsheep Broken Device (JOI17_broken_device) C
0 / 100
72 ms 3020 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);

    unsigned long long X=0;

    for(int i=0;i<150;++i)
        if(A[i]) X^=vecspace[i];

    return X;
}

Compilation message

Bruno.c:5:13: warning: 'init' defined but not used [-Wunused-function]
    5 | static void init() { for(int i=0;i<150;++i) vecspace[i]=rand()*1llu*rand(); }
      |             ^~~~
# 결과 실행 시간 메모리 Grader output
1 Partially correct 68 ms 2680 KB Output isn't correct - L* = 0
2 Partially correct 59 ms 2680 KB Output isn't correct - L* = 0
3 Partially correct 59 ms 2748 KB Output isn't correct - L* = 0
4 Partially correct 63 ms 2932 KB Output isn't correct - L* = 0
5 Partially correct 59 ms 2872 KB Output isn't correct - L* = 0
6 Partially correct 58 ms 2820 KB Output isn't correct - L* = 0
7 Partially correct 59 ms 2936 KB Output isn't correct - L* = 0
8 Partially correct 58 ms 2672 KB Output isn't correct - L* = 0
9 Partially correct 59 ms 3020 KB Output isn't correct - L* = 0
10 Partially correct 59 ms 2688 KB Output isn't correct - L* = 0
11 Partially correct 59 ms 2712 KB Output isn't correct - L* = 0
12 Partially correct 57 ms 2680 KB Output isn't correct - L* = 0
13 Partially correct 62 ms 2684 KB Output isn't correct - L* = 0
14 Partially correct 58 ms 2676 KB Output isn't correct - L* = 0
15 Partially correct 59 ms 2680 KB Output isn't correct - L* = 0
16 Partially correct 59 ms 2680 KB Output isn't correct - L* = 0
17 Partially correct 57 ms 2736 KB Output isn't correct - L* = 0
18 Partially correct 59 ms 2704 KB Output isn't correct - L* = 0
19 Partially correct 59 ms 2680 KB Output isn't correct - L* = 0
20 Partially correct 59 ms 2604 KB Output isn't correct - L* = 0
21 Partially correct 59 ms 2676 KB Output isn't correct - L* = 0
22 Partially correct 60 ms 2676 KB Output isn't correct - L* = 0
23 Partially correct 59 ms 2736 KB Output isn't correct - L* = 0
24 Partially correct 58 ms 2748 KB Output isn't correct - L* = 0
25 Partially correct 59 ms 2744 KB Output isn't correct - L* = 0
26 Partially correct 59 ms 2552 KB Output isn't correct - L* = 0
27 Partially correct 60 ms 2540 KB Output isn't correct - L* = 0
28 Partially correct 57 ms 2776 KB Output isn't correct - L* = 0
29 Partially correct 61 ms 2736 KB Output isn't correct - L* = 0
30 Partially correct 59 ms 2772 KB Output isn't correct - L* = 0
31 Partially correct 59 ms 2560 KB Output isn't correct - L* = 0
32 Partially correct 64 ms 2664 KB Output isn't correct - L* = 0
33 Partially correct 60 ms 2724 KB Output isn't correct - L* = 0
34 Partially correct 66 ms 2680 KB Output isn't correct - L* = 0
35 Partially correct 59 ms 2740 KB Output isn't correct - L* = 0
36 Partially correct 62 ms 2780 KB Output isn't correct - L* = 0
37 Partially correct 72 ms 2704 KB Output isn't correct - L* = 0
38 Partially correct 62 ms 2760 KB Output isn't correct - L* = 0
39 Partially correct 58 ms 2764 KB Output isn't correct - L* = 0
40 Partially correct 57 ms 2684 KB Output isn't correct - L* = 0