답안 #978284

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
978284 2024-05-09T05:14:18 Z sleepntsheep Broken Device (JOI17_broken_device) C
0 / 100
256 ms 3064 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()*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;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 225 ms 2528 KB Output isn't correct - L* = 0
2 Partially correct 213 ms 2528 KB Output isn't correct - L* = 0
3 Partially correct 212 ms 2300 KB Output isn't correct - L* = 0
4 Partially correct 232 ms 2792 KB Output isn't correct - L* = 0
5 Partially correct 220 ms 2372 KB Output isn't correct - L* = 0
6 Partially correct 215 ms 2476 KB Output isn't correct - L* = 0
7 Partially correct 248 ms 2484 KB Output isn't correct - L* = 0
8 Partially correct 226 ms 2464 KB Output isn't correct - L* = 0
9 Partially correct 234 ms 2540 KB Output isn't correct - L* = 0
10 Partially correct 215 ms 2312 KB Output isn't correct - L* = 0
11 Partially correct 212 ms 3064 KB Output isn't correct - L* = 0
12 Partially correct 216 ms 2600 KB Output isn't correct - L* = 0
13 Partially correct 218 ms 2484 KB Output isn't correct - L* = 0
14 Partially correct 217 ms 2512 KB Output isn't correct - L* = 0
15 Partially correct 212 ms 2312 KB Output isn't correct - L* = 0
16 Partially correct 214 ms 2524 KB Output isn't correct - L* = 0
17 Partially correct 220 ms 2760 KB Output isn't correct - L* = 0
18 Partially correct 217 ms 2300 KB Output isn't correct - L* = 0
19 Partially correct 256 ms 2300 KB Output isn't correct - L* = 0
20 Partially correct 214 ms 2408 KB Output isn't correct - L* = 0
21 Partially correct 220 ms 2468 KB Output isn't correct - L* = 0
22 Partially correct 221 ms 2300 KB Output isn't correct - L* = 0
23 Partially correct 218 ms 2560 KB Output isn't correct - L* = 0
24 Partially correct 219 ms 2376 KB Output isn't correct - L* = 0
25 Partially correct 218 ms 2532 KB Output isn't correct - L* = 0
26 Partially correct 213 ms 2300 KB Output isn't correct - L* = 0
27 Partially correct 236 ms 2472 KB Output isn't correct - L* = 0
28 Partially correct 220 ms 2344 KB Output isn't correct - L* = 0
29 Partially correct 218 ms 2632 KB Output isn't correct - L* = 0
30 Partially correct 219 ms 2556 KB Output isn't correct - L* = 0
31 Partially correct 246 ms 2376 KB Output isn't correct - L* = 0
32 Partially correct 226 ms 2396 KB Output isn't correct - L* = 0
33 Partially correct 215 ms 2300 KB Output isn't correct - L* = 0
34 Partially correct 212 ms 2536 KB Output isn't correct - L* = 0
35 Partially correct 223 ms 2516 KB Output isn't correct - L* = 0
36 Partially correct 221 ms 2464 KB Output isn't correct - L* = 0
37 Partially correct 212 ms 2300 KB Output isn't correct - L* = 0
38 Partially correct 212 ms 2312 KB Output isn't correct - L* = 0
39 Partially correct 217 ms 2312 KB Output isn't correct - L* = 0
40 Partially correct 228 ms 2524 KB Output isn't correct - L* = 0