답안 #531740

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
531740 2022-03-01T11:10:29 Z pokmui9909 Broken Device (JOI17_broken_device) C++17
0 / 100
34 ms 2476 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll C[155];
void MySet(ll n, ll a, ll b, ll c){
    Set(n, a);
    Set(n + 1, b);
    Set(n + 2, c);
}

void Anna(int N, long long X, int K, int P[]){
    fill(C, C + 155, 0);
    for(ll i = 0; i < K; i++){
        C[P[i]] = 1;
    }
    vector<ll> V;
    while(V.size() <= 154){
        V.push_back(X % 2);
        X /= 2;
    }

    for(ll i = 0, j = 0; i < 150; i += 3){
        if(C[i] + C[i + 1] + C[i + 2] == 0){
            if(V[j] == 0 && V[j + 1] == 0) MySet(i, 1, 0, 0);
            if(V[j] == 0 && V[j + 1] == 1) MySet(i, 1, 0, 1);
            if(V[j] == 1 && V[j + 1] == 0) MySet(i, 0, 1, 1);
            if(V[j] == 1 && V[j + 1] == 1) MySet(i, 1, 1, 1);
            j += 2;
        } else if(C[i] + C[i + 1] + C[i + 2] == 1) {
            if(V[j] == 0){
                if(C[j + 1] == 0){
                    MySet(i, 0, 1, 0);
                    j++;
                } else if(V[j + 1] == 0){
                    MySet(i, 1, 0, 0);
                    j += 2;
                } else {
                    MySet(i, 1, 0, 1);
                    j += 2;
                }
            } else if(C[i + 2] == 1) {
                MySet(i, 1, 1, 0);
                j++;
            } else {
                MySet(i, 0, 0, 1);
                j++;
            }
        } else {
            MySet(i, 0, 0, 0);
        }
    }
}
	
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll B[8] = {0, 1, 0, 1, 0, 2, 1, 3};
ll C[8] = {0, 1, 1, 2, 2, 2, 1, 2};

long long Bruno( int N, int A[] ){
    ll ans = 0, s = 0;
    for(int i = 0; i < N; i += 3){
        ll v = A[i] * 4 + A[i + 1] * 2 + A[i + 2];
        ans |= (B[v] << s);
        s += C[v];
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 30 ms 2176 KB Output isn't correct - L* = 0
2 Partially correct 30 ms 2216 KB Output isn't correct - L* = 0
3 Partially correct 28 ms 2260 KB Output isn't correct - L* = 0
4 Partially correct 30 ms 2344 KB Output isn't correct - L* = 0
5 Partially correct 30 ms 2224 KB Output isn't correct - L* = 0
6 Partially correct 34 ms 2268 KB Output isn't correct - L* = 0
7 Partially correct 30 ms 2240 KB Output isn't correct - L* = 0
8 Partially correct 28 ms 2348 KB Output isn't correct - L* = 0
9 Partially correct 30 ms 2240 KB Output isn't correct - L* = 0
10 Partially correct 28 ms 2224 KB Output isn't correct - L* = 0
11 Partially correct 32 ms 2200 KB Output isn't correct - L* = 0
12 Partially correct 31 ms 2300 KB Output isn't correct - L* = 0
13 Partially correct 30 ms 2232 KB Output isn't correct - L* = 0
14 Partially correct 30 ms 2408 KB Output isn't correct - L* = 0
15 Partially correct 32 ms 2208 KB Output isn't correct - L* = 0
16 Partially correct 30 ms 2248 KB Output isn't correct - L* = 0
17 Partially correct 31 ms 2344 KB Output isn't correct - L* = 0
18 Partially correct 30 ms 2312 KB Output isn't correct - L* = 0
19 Partially correct 30 ms 2440 KB Output isn't correct - L* = 0
20 Partially correct 30 ms 2256 KB Output isn't correct - L* = 0
21 Partially correct 30 ms 2300 KB Output isn't correct - L* = 0
22 Partially correct 30 ms 2268 KB Output isn't correct - L* = 0
23 Partially correct 34 ms 2476 KB Output isn't correct - L* = 0
24 Partially correct 34 ms 2224 KB Output isn't correct - L* = 0
25 Partially correct 30 ms 2204 KB Output isn't correct - L* = 0
26 Partially correct 31 ms 2236 KB Output isn't correct - L* = 0
27 Partially correct 28 ms 2296 KB Output isn't correct - L* = 0
28 Partially correct 30 ms 2264 KB Output isn't correct - L* = 0
29 Partially correct 31 ms 2424 KB Output isn't correct - L* = 0
30 Partially correct 30 ms 2324 KB Output isn't correct - L* = 0
31 Partially correct 30 ms 2220 KB Output isn't correct - L* = 0
32 Partially correct 30 ms 2336 KB Output isn't correct - L* = 0
33 Partially correct 31 ms 2240 KB Output isn't correct - L* = 0
34 Partially correct 28 ms 2304 KB Output isn't correct - L* = 0
35 Partially correct 30 ms 2304 KB Output isn't correct - L* = 0
36 Partially correct 30 ms 2220 KB Output isn't correct - L* = 0
37 Partially correct 31 ms 2324 KB Output isn't correct - L* = 0
38 Partially correct 31 ms 2332 KB Output isn't correct - L* = 0
39 Partially correct 33 ms 2220 KB Output isn't correct - L* = 0
40 Partially correct 31 ms 2292 KB Output isn't correct - L* = 0