# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1154626 | itslq | Broken Device (JOI17_broken_device) | C++20 | 19 ms | 1344 KiB |
#include "Annalib.h"
#include <bits/stdc++.h>
#define int long long
using namespace std;
vector<int> getDigits(int X) {
vector<int> d(38);
for (int i = 0; i < 38; i++) {
d[37 - i] = X % 3;
X /= 3;
}
return d;
}
void Anna(signed N, long long X, signed K, signed P[] ){
vector<int> blank(75), digits = getDigits(X);
for (int i = 0; i < K; i++) {
blank[P[i] % 60] = 1;
}
for (int i = 0; i < 75; i++) {
if (blank[i]) {
Set(i, 0);
Set(i + 75, 0);
} else if (digits[i] == 0) {
Set(i, 0);
Set(i + 75, 1);
} else if (digits[i] == 1) {
Set(i, 1);
Set(i + 75, 0);
} else {
Set(i, 1);
Set(i + 75, 1);
}
}
}
#include "Brunolib.h"
#define int long long
long long Bruno( signed N, signed A[] ){
int S = 0;
for (int i = 0; i < 75; i++) {
if (!(A[i] | A[i + 75])) continue;
S *= 3;
if (A[i]) S += 2;
if (A[i + 75]) S++;
S--;
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |