# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
709623 | lmqzzz | Ancient Machine (JOI21_ancient_machine) | C++17 | 8 ms | 1848 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 "Anna.h"
#include <bits/stdc++.h>
using namespace std;
void send(int x) {
bitset<17> a(x);
for (int i = 0; i < 17; i++) Send(a[i]);
}
void Anna(int N, std::vector<char> S) {
string temp = "XYZ";
int j = 0;
for (int i = 0; i < N; i++) {
if (S[i] == temp[j]) {
j++;
j %= 3;
send(i);
}
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
int a[100001];
void Bruno(int N, int L, std::vector<int> A) {
assert(L % 17 == 0);
vector<int> v;
for (int i = 0; i < L; i += 17) {
int pos = 0;
for (int j = i; j < i + 17; j++) {
if (A[j]) pos |= 1 << (j - i);
}
v.emplace_back(pos);
a[pos] = 1;
}
for (int i = 0; i < N; i++)
if (a[i] == 0) Remove(i);
for (int i = 1; i < v.size(); i += 3) {
Remove(v[i]);
}
for (int i = 0; i < v.size(); i++) {
if (i % 3 == 1) continue;
Remove(v[i]);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |