# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
798374 | ymm | Ancient Machine (JOI21_ancient_machine) | C++17 | 47 ms | 8400 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>
#define Loop(x,l,r) for (ll x = (l); x < (r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (l); --x)
typedef long long ll;
using namespace std;
namespace {
int variable_example = 0;
}
void Anna(int N, std::vector<char> S) {
int p = 0;
while (p < N && S[p] != 'X')
++p;
if (p == N) {
Loop (i,0,N)
Send(0);
return;
}
Loop (i,0,p)
Send(0);
Send(1);
Loop (i,p+1,N)
Send(S[i] == 'Z');
}
#include "Bruno.h"
#include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (l); --x)
typedef long long ll;
using namespace std;
namespace {
int variable_example = 0;
int FunctionExample(int P) { return 1 - P; }
} // namespace
void Bruno(int N, int L, std::vector<int> A) {
int p = 0;
while (p < N && !A[p])
++p;
if (p == N) {
Loop (i,0,N)
Remove(i);
return;
}
int lst = p+1;
Loop (p2,p+1,N) {
if (!A[p2])
continue;
LoopR (j,lst,p2)
Remove(j);
Remove(p2);
lst = p2+1;
}
Loop (i,0,p+1)
Remove(i);
Loop (i,lst,N)
Remove(i);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |