답안 #1077200

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1077200 2024-08-27T02:52:51 Z AMO5 Broken Device (JOI17_broken_device) C++17
67 / 100
31 ms 3028 KB
#include "Annalib.h"
#include "bits/stdc++.h"
using namespace std;

void Anna( int N, long long X, int K, int P[] ){
    std::vector<int>bad(N, 0);
    for(int i=0; i<K; i++)bad[P[i]]=1;

    long long tmp = X;
    for(int i=0; i<N; i+=3){
        if(bad[i] || (i + 1 < N && bad[i+1]) || (i + 2 < N && bad[i+2])  || tmp == 0){
            Set(i, 0);
            Set(i+1, 0);
            Set(i+2, 0);
        }else{
            int bit = tmp % 7 + 1;
            Set(i, bit / 4);
            Set(i+1, bit % 4 / 2);
            Set(i+2, bit % 2);
            tmp /= 7;
        }
    }
}
#include "Brunolib.h"
#include "bits/stdc++.h"
using namespace std;

long long Bruno( int N, int A[] ){
    std::vector<int>bits;
    for(int i=0; i<N; i+=3){
        if(A[i] == 0 && A[i+1] == 0 && A[i+2] == 0)continue;
        int val = 4 * A[i] + 2 * A[i+1] + A[i+2] - 1;
        bits.emplace_back(val);
    }
    long long answer = 0LL;
    while(!bits.empty()){
        answer *= 7LL;
        answer += bits.back();
        bits.pop_back();
    }
    return answer;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 20 ms 2776 KB Output is partially correct - L* = 29
2 Partially correct 22 ms 2852 KB Output is partially correct - L* = 28
3 Partially correct 20 ms 2772 KB Output is partially correct - L* = 28
4 Partially correct 20 ms 2772 KB Output is partially correct - L* = 28
5 Partially correct 20 ms 2784 KB Output is partially correct - L* = 28
6 Partially correct 28 ms 2772 KB Output is partially correct - L* = 29
7 Partially correct 22 ms 2864 KB Output is partially correct - L* = 29
8 Partially correct 22 ms 3028 KB Output is partially correct - L* = 29
9 Partially correct 23 ms 2776 KB Output is partially correct - L* = 28
10 Partially correct 20 ms 2864 KB Output is partially correct - L* = 28
11 Partially correct 20 ms 2884 KB Output is partially correct - L* = 30
12 Partially correct 22 ms 2876 KB Output is partially correct - L* = 28
13 Partially correct 22 ms 2784 KB Output is partially correct - L* = 28
14 Partially correct 20 ms 2772 KB Output is partially correct - L* = 29
15 Partially correct 20 ms 2772 KB Output is partially correct - L* = 29
16 Partially correct 20 ms 2784 KB Output is partially correct - L* = 28
17 Partially correct 23 ms 2832 KB Output is partially correct - L* = 31
18 Partially correct 23 ms 2856 KB Output is partially correct - L* = 29
19 Partially correct 20 ms 2784 KB Output is partially correct - L* = 29
20 Partially correct 22 ms 2776 KB Output is partially correct - L* = 29
21 Partially correct 20 ms 2760 KB Output is partially correct - L* = 28
22 Partially correct 22 ms 2772 KB Output is partially correct - L* = 28
23 Partially correct 24 ms 3024 KB Output is partially correct - L* = 29
24 Partially correct 28 ms 2772 KB Output is partially correct - L* = 29
25 Partially correct 20 ms 2784 KB Output is partially correct - L* = 28
26 Partially correct 20 ms 2856 KB Output is partially correct - L* = 28
27 Partially correct 20 ms 2848 KB Output is partially correct - L* = 28
28 Partially correct 22 ms 2856 KB Output is partially correct - L* = 28
29 Partially correct 26 ms 2780 KB Output is partially correct - L* = 29
30 Partially correct 20 ms 2784 KB Output is partially correct - L* = 28
31 Partially correct 22 ms 2772 KB Output is partially correct - L* = 29
32 Partially correct 30 ms 2868 KB Output is partially correct - L* = 28
33 Partially correct 22 ms 2768 KB Output is partially correct - L* = 29
34 Partially correct 20 ms 2780 KB Output is partially correct - L* = 29
35 Partially correct 23 ms 2772 KB Output is partially correct - L* = 28
36 Partially correct 31 ms 2680 KB Output is partially correct - L* = 28
37 Partially correct 20 ms 2776 KB Output is partially correct - L* = 30
38 Partially correct 22 ms 2748 KB Output is partially correct - L* = 28
39 Partially correct 24 ms 2772 KB Output is partially correct - L* = 28
40 Partially correct 22 ms 2780 KB Output is partially correct - L* = 28