# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1236086 | luvlorndev | Broken Device (JOI17_broken_device) | C++20 | 20 ms | 1592 KiB |
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
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;
#define ll long long
ll Bruno (int n, int a[]) {
ll now = 1, ans = 0;
for (int i = 0; i + 1 < n; i++) {
if (a[i] == 1) {
ans = ans | now * a[i + 1];
now <<= 1;
i++;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |