# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1217746 | rythm_of_knight | Broken Device (JOI17_broken_device) | C++17 | 23 ms | 1344 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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |