제출 #1217746

#제출 시각아이디문제언어결과실행 시간메모리
1217746rythm_of_knightBroken Device (JOI17_broken_device)C++17
0 / 100
23 ms1344 KiB
#include "Annalib.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

void Anna (int n, ll x, int k, int p[]) {
    vector <int> a(n, 1);
    for (int i = 0; i < k; i++)
        a[p[i]] = 0;
    for (int i = 0; i < n; i++) {
        if (i + 1 < n && a[i] && a[i + 1]) {
            Set(i, 1);
            Set(i + 1, x & 1);
            x >>= 1;
            i++;
        } else {
            Set(i, 0);
        }
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

ll Bruno (int n, int a[]) {
    ll now = 1, ans = 0;
    for (int i = 0; i < n; i++)
        cout << a[i];
    cout << ' ';
    for (int i = 0; i + 1 < n; i++) {
        if (a[i] == 1) {
            ans |= now * a[i + 1];
            now <<= 1;
            i++;
        }
    }
    cout << ans << '\n';
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...