답안 #26820

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
26820 2017-07-06T07:25:08 Z wangyenjen Broken Device (JOI17_broken_device) C++14
0 / 100
128 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 < 50; j++) {
            int x = (i * 2 + j) % N;
            if(st[x]) A[i][x] = 0;
            else A[i][x] = 1;
        }
        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 < 50; j++) {
            int t = (i * 2 + j) % N;
            X ^= ((long long)A[t]<<i);
        }
    }
    return X;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 102 ms 4640 KB Output isn't correct - L* = 0
2 Incorrect 128 ms 4640 KB Output isn't correct - L* = 0
3 Incorrect 96 ms 4640 KB Output isn't correct - L* = 0
4 Incorrect 111 ms 4640 KB Output isn't correct - L* = 0
5 Incorrect 109 ms 4640 KB Output isn't correct - L* = 0
6 Incorrect 109 ms 4640 KB Output isn't correct - L* = 0
7 Incorrect 119 ms 4640 KB Output isn't correct - L* = 0
8 Incorrect 95 ms 4640 KB Output isn't correct - L* = 0
9 Incorrect 111 ms 4640 KB Output isn't correct - L* = 0
10 Incorrect 106 ms 4640 KB Output isn't correct - L* = 0
11 Incorrect 122 ms 4640 KB Output isn't correct - L* = 0
12 Incorrect 126 ms 4640 KB Output isn't correct - L* = 0
13 Incorrect 108 ms 4640 KB Output isn't correct - L* = 0
14 Incorrect 111 ms 4640 KB Output isn't correct - L* = 0
15 Incorrect 111 ms 4640 KB Output isn't correct - L* = 0
16 Incorrect 108 ms 4640 KB Output isn't correct - L* = 0
17 Incorrect 109 ms 4640 KB Output isn't correct - L* = 0
18 Incorrect 111 ms 4640 KB Output isn't correct - L* = 0
19 Incorrect 105 ms 4640 KB Output isn't correct - L* = 0
20 Incorrect 109 ms 4640 KB Output isn't correct - L* = 0
21 Incorrect 109 ms 4640 KB Output isn't correct - L* = 0
22 Incorrect 108 ms 4640 KB Output isn't correct - L* = 0
23 Incorrect 111 ms 4640 KB Output isn't correct - L* = 0
24 Incorrect 108 ms 4640 KB Output isn't correct - L* = 0
25 Incorrect 106 ms 4640 KB Output isn't correct - L* = 0
26 Incorrect 102 ms 4640 KB Output isn't correct - L* = 0
27 Incorrect 114 ms 4640 KB Output isn't correct - L* = 0
28 Incorrect 98 ms 4640 KB Output isn't correct - L* = 0
29 Incorrect 106 ms 4640 KB Output isn't correct - L* = 0
30 Incorrect 112 ms 4640 KB Output isn't correct - L* = 0
31 Incorrect 102 ms 4640 KB Output isn't correct - L* = 0
32 Incorrect 108 ms 4640 KB Output isn't correct - L* = 0
33 Incorrect 128 ms 4640 KB Output isn't correct - L* = 0
34 Incorrect 114 ms 4640 KB Output isn't correct - L* = 0
35 Incorrect 122 ms 4640 KB Output isn't correct - L* = 0
36 Incorrect 102 ms 4640 KB Output isn't correct - L* = 0
37 Incorrect 108 ms 4640 KB Output isn't correct - L* = 0
38 Incorrect 109 ms 4640 KB Output isn't correct - L* = 0
39 Incorrect 112 ms 4640 KB Output isn't correct - L* = 0
40 Incorrect 105 ms 4640 KB Output isn't correct - L* = 0