답안 #1029779

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1029779 2024-07-21T10:22:05 Z borisAngelov Broken Device (JOI17_broken_device) C++17
0 / 100
27 ms 3036 KB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;

int n, k;
long long x;
bool isBlocked[200];

void Anna(int N, long long X, int K, int P[])
{
    n = N;
    x = X;
    k = K;

    for (int i = 0; i < k; ++i)
    {
        isBlocked[P[i]] = true;
    }

    int bit = 0;

    for (int i = 0; i < n; ++i)
    {
        if (i < n - 2 && isBlocked[i] == false && isBlocked[i + 1] == false)
        {
            if ((x & (1LL << bit)) != 0)
            {
                Set(i, 1);
            }
            else
            {
                Set(i, 0);
            }

            Set(i + 1, 1);
            Set(i + 2, 0);
            i += 2;
            ++bit;
        }
        else
        {
            Set(i, 0);
        }
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;

int a[200];

long long Bruno(int N, int A[])
{
    int n = N;

    for (int i = 0; i < n; ++i)
    {
        a[i] = A[i];
        //cout << a[i] << " ";
    }

    //cout << endl;

    long long ans = 0;
    int bit = 0;

    for (int i = 0; i < n; ++i)
    {
        if (a[i] == 1)
        {
            if (i < n - 1 && a[i + 1] == 1)
            {
                ans += (1LL << bit);
                //cout << i << " " << bit << endl;
                i += 2;
            }

            ++bit;
        }
    }

    cout << ans << endl;

    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 25 ms 2776 KB Program terminated incorrectly, or you printed something to stdout
2 Incorrect 27 ms 2776 KB Program terminated incorrectly, or you printed something to stdout
3 Incorrect 20 ms 2772 KB Program terminated incorrectly, or you printed something to stdout
4 Incorrect 20 ms 2748 KB Program terminated incorrectly, or you printed something to stdout
5 Incorrect 20 ms 2772 KB Program terminated incorrectly, or you printed something to stdout
6 Incorrect 20 ms 2776 KB Program terminated incorrectly, or you printed something to stdout
7 Incorrect 25 ms 2884 KB Program terminated incorrectly, or you printed something to stdout
8 Incorrect 20 ms 2768 KB Program terminated incorrectly, or you printed something to stdout
9 Incorrect 20 ms 2784 KB Program terminated incorrectly, or you printed something to stdout
10 Incorrect 20 ms 3036 KB Program terminated incorrectly, or you printed something to stdout
11 Incorrect 20 ms 2784 KB Program terminated incorrectly, or you printed something to stdout
12 Incorrect 20 ms 2808 KB Program terminated incorrectly, or you printed something to stdout
13 Incorrect 20 ms 2884 KB Program terminated incorrectly, or you printed something to stdout
14 Incorrect 22 ms 2908 KB Program terminated incorrectly, or you printed something to stdout
15 Incorrect 24 ms 2772 KB Program terminated incorrectly, or you printed something to stdout
16 Incorrect 20 ms 2720 KB Program terminated incorrectly, or you printed something to stdout
17 Incorrect 20 ms 2772 KB Program terminated incorrectly, or you printed something to stdout
18 Incorrect 20 ms 2772 KB Program terminated incorrectly, or you printed something to stdout
19 Incorrect 20 ms 2776 KB Program terminated incorrectly, or you printed something to stdout
20 Incorrect 20 ms 2752 KB Program terminated incorrectly, or you printed something to stdout
21 Incorrect 22 ms 2772 KB Program terminated incorrectly, or you printed something to stdout
22 Incorrect 20 ms 2772 KB Program terminated incorrectly, or you printed something to stdout
23 Incorrect 20 ms 2864 KB Program terminated incorrectly, or you printed something to stdout
24 Incorrect 22 ms 2776 KB Program terminated incorrectly, or you printed something to stdout
25 Incorrect 20 ms 2784 KB Program terminated incorrectly, or you printed something to stdout
26 Incorrect 20 ms 2876 KB Program terminated incorrectly, or you printed something to stdout
27 Incorrect 20 ms 2776 KB Program terminated incorrectly, or you printed something to stdout
28 Incorrect 20 ms 2780 KB Program terminated incorrectly, or you printed something to stdout
29 Incorrect 22 ms 2780 KB Program terminated incorrectly, or you printed something to stdout
30 Incorrect 20 ms 2776 KB Program terminated incorrectly, or you printed something to stdout
31 Incorrect 20 ms 2772 KB Program terminated incorrectly, or you printed something to stdout
32 Incorrect 20 ms 2876 KB Program terminated incorrectly, or you printed something to stdout
33 Incorrect 24 ms 2780 KB Program terminated incorrectly, or you printed something to stdout
34 Incorrect 20 ms 2772 KB Program terminated incorrectly, or you printed something to stdout
35 Incorrect 20 ms 2796 KB Program terminated incorrectly, or you printed something to stdout
36 Incorrect 22 ms 2812 KB Program terminated incorrectly, or you printed something to stdout
37 Incorrect 22 ms 2868 KB Program terminated incorrectly, or you printed something to stdout
38 Incorrect 20 ms 2788 KB Program terminated incorrectly, or you printed something to stdout
39 Incorrect 22 ms 2752 KB Program terminated incorrectly, or you printed something to stdout
40 Incorrect 23 ms 2776 KB Program terminated incorrectly, or you printed something to stdout