# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
753520 | piOOE | Broken Device (JOI17_broken_device) | C++17 | 41 ms | 2404 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll Y = 983154202215176696LL;
vector<int> p = {40, 132, 49, 85, 109, 98, 33, 63, 86, 37, 130, 80, 18, 72, 2, 76, 45, 146, 129, 46, 25, 122, 19, 81, 115, 30, 21, 50, 73, 61, 89, 24, 32, 99, 52, 29, 108, 0, 139, 54, 11, 100, 131, 137, 95, 102, 148, 69, 82, 35, 38, 74, 13, 62, 127, 26, 79, 134, 125, 16, 4, 42, 58, 44, 57, 70, 65, 10, 133, 116, 83, 48, 118, 34, 84, 53, 68, 1, 117, 136, 28, 64, 135, 47, 91, 140, 106, 55, 66, 87, 90, 43, 101, 88, 110, 39, 141, 124, 113, 119, 107, 96, 143, 41, 120, 14, 71, 149, 7, 94, 104, 105, 123, 77, 138, 51, 142, 3, 92, 121, 144, 145, 126, 17, 22, 114, 15, 31, 27, 9, 78, 75, 12, 60, 128, 8, 111, 112, 36, 67, 103, 6, 147, 23, 56, 5, 59, 93, 20, 97};
const string B = "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010";
void Anna(int N, long long X, int K, int P[]) {
vector<int> a(N), used(N);
X ^= Y;
for (int i = 0; i < K; ++i) {
used[P[i]] = true;
}
for (int i = 0, b = 0; i < N; ++i) {
if (!used[p[i]] && (X >> b & 1) == (B[i] - '0')) {
a[p[i]] = 1;
b += 1;
}
}
for (int i = 0; i < N; i++) {
Set(i, a[i]);
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll Y = 983154202215176696LL;
vector<int> p = {40, 132, 49, 85, 109, 98, 33, 63, 86, 37, 130, 80, 18, 72, 2, 76, 45, 146, 129, 46, 25, 122, 19, 81, 115, 30, 21, 50, 73, 61, 89, 24, 32, 99, 52, 29, 108, 0, 139, 54, 11, 100, 131, 137, 95, 102, 148, 69, 82, 35, 38, 74, 13, 62, 127, 26, 79, 134, 125, 16, 4, 42, 58, 44, 57, 70, 65, 10, 133, 116, 83, 48, 118, 34, 84, 53, 68, 1, 117, 136, 28, 64, 135, 47, 91, 140, 106, 55, 66, 87, 90, 43, 101, 88, 110, 39, 141, 124, 113, 119, 107, 96, 143, 41, 120, 14, 71, 149, 7, 94, 104, 105, 123, 77, 138, 51, 142, 3, 92, 121, 144, 145, 126, 17, 22, 114, 15, 31, 27, 9, 78, 75, 12, 60, 128, 8, 111, 112, 36, 67, 103, 6, 147, 23, 56, 5, 59, 93, 20, 97};
const string B = "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010";
long long Bruno(int N, int A[]) {
ll X = 0;
for (int i = 0, b = 0; i < N; ++i) {
if (A[p[i]]) {
X |= ll(B[i] - '0') << b;
b += 1;
}
}
X ^= Y;
return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |