# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1174370 | ortsac | Broken Device (JOI17_broken_device) | C++20 | 1 ms | 576 KiB |
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
void Anna(int32_t N, int x, int32_t k, int32_t p[] ){
// N = 150
vector<int> ans(150);
vector<int> broken(150);
for (int i = 0; i < k; i++) broken[p[i]] = 1;
int curr = 0;
for (int i = 0; i < 60; i++) {
int v = (((1LL << i) & x) > 0);
while (broken[curr] || broken[curr + 1]) curr += 2;
broken[curr] = 1;
broken[curr + 1] = v;
curr += 2;
}
for (int i = 0; i < 150; i++) Set(i, ans[i]);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |