답안 #26816

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
26816 2017-07-06T07:09:59 Z wangyenjen Broken Device (JOI17_broken_device) C++14
0 / 100
149 ms 4640 KB
/// Author: Wang, Yen-Jen
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

static bool st[150];
static bool val[150];
static bool vis[150];
static bitset<151> A[60];

void Anna(int N , long long X , int K , int P[]) {
    memset(st , 0 , sizeof(st));
    for(int i = 0; i < K; i++) st[P[i]] = 1;
    for(int i = 0; i < 60; i++) {
        A[i].reset();
        for(int j = 0; j < N; j++) {
            if((j + 1) & (1<<(i % 5))) {
                if(st[j]) A[i][j] = 0;
                else A[i][j] = 1;
            }
            else A[i][j] = 0;
        }
        A[i][N] = ((X>>i)&1);
    }
    memset(val , 0 , sizeof(val));
    memset(vis , 0 , sizeof(vis));
    int cnt = 0;
    for(int i = 0; i < N; i++) {
        int p = -1;
        for(int j = cnt; j < 60; j++) {
            if(A[j][i]) {
                p = j;
                break;
            }
        }
        if(p == -1) continue;
        if(p != cnt) swap(A[p] , A[cnt]);
        for(int j = cnt + 1; j < 60; j++) {
            if(A[j][i]) A[j] ^= A[cnt];
        }
        vis[i] = 1;
        if(++cnt == 60) break;
    }
    for(int i = 0; i < N; i++) {
        if(!st[i]) {
            if(!vis[i]) {
                vis[i] = 1;
                val[i] = 0;
            }
            else vis[i] = 0;
        }
        else vis[i] = 1;
    }
    for(int i = 59; i >= 0; i--) {
        int p = -1;
        for(int j = 0; j < N; j++) {
            if(A[i][j]) {
                if(vis[j]) {
                    A[i][N] = (A[i][N] ^ val[j]);
                    A[i][j] = 0;
                }
                else p = j;
            }
        }
        if(p != -1) {
            vis[p] = 1;
            val[p] = A[i][N];
        }
    }
    for(int i = 0; i < N; i++) assert(vis[i]);
    for(int i = 0; i < N; i++) Set(i , val[i]);
}
/// Author: Wang, Yen-Jen
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;

long long Bruno(int N , int A[]) {
    long long X = 0;
    for(int i = 0; i < 60; i++) {
        for(int j = 0; j < N; j++) {
            if((j + 1) & (1<<(i % 5))) X ^= ((long long)A[j]<<i);
        }
    }
    return X;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 98 ms 4640 KB Output isn't correct - L* = 0
2 Incorrect 105 ms 4640 KB Output isn't correct - L* = 0
3 Incorrect 92 ms 4640 KB Output isn't correct - L* = 0
4 Incorrect 112 ms 4640 KB Output isn't correct - L* = 0
5 Incorrect 98 ms 4640 KB Output isn't correct - L* = 0
6 Incorrect 118 ms 4640 KB Output isn't correct - L* = 0
7 Incorrect 102 ms 4640 KB Output isn't correct - L* = 0
8 Incorrect 98 ms 4640 KB Output isn't correct - L* = 0
9 Incorrect 149 ms 4640 KB Output isn't correct - L* = 0
10 Incorrect 105 ms 4640 KB Output isn't correct - L* = 0
11 Incorrect 115 ms 4640 KB Output isn't correct - L* = 0
12 Incorrect 106 ms 4640 KB Output isn't correct - L* = 0
13 Incorrect 102 ms 4640 KB Output isn't correct - L* = 0
14 Incorrect 92 ms 4640 KB Output isn't correct - L* = 0
15 Incorrect 111 ms 4640 KB Output isn't correct - L* = 0
16 Incorrect 126 ms 4640 KB Output isn't correct - L* = 0
17 Incorrect 102 ms 4640 KB Output isn't correct - L* = 0
18 Incorrect 148 ms 4640 KB Output isn't correct - L* = 0
19 Incorrect 92 ms 4640 KB Output isn't correct - L* = 0
20 Incorrect 111 ms 4640 KB Output isn't correct - L* = 0
21 Incorrect 105 ms 4640 KB Output isn't correct - L* = 0
22 Incorrect 111 ms 4640 KB Output isn't correct - L* = 0
23 Incorrect 129 ms 4640 KB Output isn't correct - L* = 0
24 Incorrect 122 ms 4640 KB Output isn't correct - L* = 0
25 Incorrect 108 ms 4640 KB Output isn't correct - L* = 0
26 Incorrect 98 ms 4640 KB Output isn't correct - L* = 0
27 Incorrect 98 ms 4640 KB Output isn't correct - L* = 0
28 Incorrect 98 ms 4640 KB Output isn't correct - L* = 0
29 Incorrect 109 ms 4640 KB Output isn't correct - L* = 0
30 Incorrect 112 ms 4640 KB Output isn't correct - L* = 0
31 Incorrect 98 ms 4640 KB Output isn't correct - L* = 0
32 Incorrect 105 ms 4640 KB Output isn't correct - L* = 0
33 Incorrect 125 ms 4640 KB Output isn't correct - L* = 0
34 Incorrect 128 ms 4640 KB Output isn't correct - L* = 0
35 Incorrect 114 ms 4640 KB Output isn't correct - L* = 0
36 Incorrect 114 ms 4640 KB Output isn't correct - L* = 0
37 Incorrect 122 ms 4640 KB Output isn't correct - L* = 0
38 Incorrect 102 ms 4640 KB Output isn't correct - L* = 0
39 Incorrect 114 ms 4640 KB Output isn't correct - L* = 0
40 Incorrect 95 ms 4640 KB Output isn't correct - L* = 0