답안 #100067

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
100067 2019-03-09T07:59:50 Z jeff Broken Device (JOI17_broken_device) C++14
0 / 100
77 ms 3312 KB
#include <bits/stdc++.h>
#include "Annalib.h"
using namespace std;

long long rng(long long i) {
    long long r = 0;
    for (int j = 0; j < 5; ++j) r *= RAND_MAX, r += rand(), r %= i;
    return r;
}

void Anna(int N, long long X, int K, int P[]) {
  	srand(10);
  	X ^= rng(1LL << 60);
    int A[50], s[150], i, j, k;
    bool f[N];
    queue<int> q;
    memset(A, -1, sizeof(A));
    for (i = 0; i < N; ++i) f[i] = 1;
    for (i = 0; i < K; ++i) f[P[i]] = 0;
    for (i = 0; i < 150; ++i) s[i] = X % 2, X /= 2, q.push(i);
    j = q.front();
    q.pop();
    k = q.front();
    q.pop();
    for (i = 0; i < N; i += 3) {
        if (j > k) swap(j, k);
        if (!s[j] && !s[k] && f[i] && f[i + 1]) {A[i / 3] = 110; j = q.front(); q.pop(); k = q.front(); q.pop(); continue;}
        if (!s[j] && s[k] && f[i]) {A[i / 3] = 100; j = q.front(); q.pop(); k = q.front(); q.pop(); continue;}
        if (s[j] && s[k] && f[i] && f[i + 2]) {A[i / 3] = 101; j = q.front(); q.pop(); k = q.front(); q.pop(); continue;}
        if (s[j] && !s[k] && f[i] && f[i + 1] && f[i + 2]) {A[i / 3] = 111; j = q.front(); q.pop(); k = q.front(); q.pop(); continue;}
        if (!s[j] && f[i + 1] && f[i + 2]) {A[i / 3] = 11; j = q.front(); q.pop(); continue;}
        if (s[j] && f[i + 1]) {A[i / 3] = 10; j = q.front(); q.pop(); continue;}
        if (!s[k] && f[i + 2]) {A[i / 3] = 1; k = q.front(); q.pop(); continue;}
        A[i / 3] = 0;
    }
    for (i = 0; i < N / 3; ++i) Set(i * 3, A[i] / 100), Set(i * 3 + 1, A[i] / 10 % 10), Set(i * 3 + 2, A[i] % 10);
}
#include <bits/stdc++.h>
#include "Brunolib.h"
using namespace std;

long long rng(long long i) {
    long long r = 0;
    for (int j = 0; j < 5; ++j) r *= RAND_MAX, r += rand(), r %= i;
    return r;
}

long long Bruno(int N, int A[]) {
  	srand(10);
    long long r = 0, l = 1;
    int s[150], i, j, k;
    memset(s, 0, sizeof(s));
    queue<int> q;
    for (i = 0; i < 150; ++i) q.push(i);
    j = q.front();
    q.pop();
    k = q.front();
    q.pop();
    for (i = 0; i < N; i += 3) {
        if (j > k) swap(j, k);
        if (A[i] && A[i + 1] && A[i + 2]) {s[j] = 1; s[k] = 0; j = q.front(); q.pop(); k = q.front(); q.pop(); continue;}
        if (A[i] && A[i + 1]) {s[j] = 0; s[k] = 0; j = q.front(); q.pop(); k = q.front(); q.pop(); continue;}
        if (A[i] && A[i + 2]) {s[j] = 1; s[k] = 1; j = q.front(); q.pop(); k = q.front(); q.pop(); continue;}
        if (A[i + 1] && A[i + 2]) {s[j] = 0; j = q.front(); q.pop(); continue;}
        if (A[i]) {s[j] = 0; s[k] = 1; j = q.front(); q.pop(); k = q.front(); q.pop(); continue;}
        if (A[i + 1]) {s[j] = 1; j = q.front(); q.pop(); continue;}
        if (A[i + 2]) {s[k] = 0; k = q.front(); q.pop(); continue;}
    }
    for (i = 0; i < 150 && s[i] > -1; ++i) {
        r += l * s[i];
        l *= 2;
    }
  	r ^= rng(1LL << 60);
    return r;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 48 ms 3072 KB Output isn't correct - L* = 0
2 Incorrect 54 ms 3072 KB Output isn't correct - L* = 0
3 Incorrect 52 ms 2952 KB Output isn't correct - L* = 0
4 Incorrect 66 ms 2896 KB Output isn't correct - L* = 0
5 Incorrect 64 ms 3008 KB Output isn't correct - L* = 0
6 Incorrect 50 ms 3056 KB Output isn't correct - L* = 0
7 Incorrect 51 ms 3056 KB Output isn't correct - L* = 0
8 Incorrect 54 ms 3072 KB Output isn't correct - L* = 0
9 Incorrect 59 ms 3056 KB Output isn't correct - L* = 0
10 Incorrect 59 ms 3056 KB Output isn't correct - L* = 0
11 Incorrect 50 ms 3056 KB Output isn't correct - L* = 0
12 Incorrect 77 ms 3056 KB Output isn't correct - L* = 0
13 Incorrect 54 ms 3072 KB Output isn't correct - L* = 0
14 Incorrect 46 ms 3056 KB Output isn't correct - L* = 0
15 Incorrect 63 ms 3312 KB Output isn't correct - L* = 0
16 Incorrect 68 ms 3056 KB Output isn't correct - L* = 0
17 Incorrect 46 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 48 ms 3072 KB Output isn't correct - L* = 0
19 Incorrect 53 ms 3072 KB Output isn't correct - L* = 0
20 Incorrect 71 ms 3072 KB Output isn't correct - L* = 0
21 Incorrect 61 ms 3056 KB Output isn't correct - L* = 0
22 Incorrect 77 ms 3216 KB Output isn't correct - L* = 0
23 Incorrect 57 ms 2816 KB Output isn't correct - L* = 0
24 Incorrect 59 ms 3064 KB Output isn't correct - L* = 0
25 Incorrect 65 ms 3056 KB Output isn't correct - L* = 0
26 Incorrect 51 ms 3072 KB Output isn't correct - L* = 0
27 Incorrect 49 ms 3072 KB Output isn't correct - L* = 0
28 Incorrect 47 ms 3056 KB Output isn't correct - L* = 0
29 Incorrect 68 ms 2800 KB Output isn't correct - L* = 0
30 Incorrect 50 ms 3056 KB Output isn't correct - L* = 0
31 Incorrect 51 ms 3056 KB Output isn't correct - L* = 0
32 Incorrect 74 ms 3056 KB Output isn't correct - L* = 0
33 Incorrect 58 ms 3072 KB Output isn't correct - L* = 0
34 Incorrect 51 ms 3056 KB Output isn't correct - L* = 0
35 Incorrect 52 ms 3056 KB Output isn't correct - L* = 0
36 Incorrect 51 ms 3056 KB Output isn't correct - L* = 0
37 Incorrect 65 ms 3312 KB Output isn't correct - L* = 0
38 Incorrect 48 ms 2800 KB Output isn't correct - L* = 0
39 Incorrect 65 ms 3056 KB Output isn't correct - L* = 0
40 Incorrect 72 ms 2800 KB Output isn't correct - L* = 0