# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
417218 | tqbfjotld | Ancient Machine (JOI21_ancient_machine) | C++17 | 79 ms | 8340 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 <vector>
using namespace std;
void Anna(int N, std::vector<char> S) {
bool found = false;
for (int x = 0; x<N; x++){
if (S[x]=='X') found = true;
Send((!found) || S[x]=='Z');
}
}
#include "Bruno.h"
#include <vector>
#include <cassert>
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
assert(L==N);
int Xpos = -1;
for (int x = 0; x<N; x++){
if (!A[x]){
Xpos = x;
break;
}
}
if (Xpos==-1){
for (int x = 0; x<N; x++){
Remove(x);
}
return;
}
vector<int> rem;
for (int x = 0; x<Xpos; x++){
Remove(x);
}
for (int x = Xpos+1; x<N; x++){
if (A[x]){
while (!rem.empty()){
Remove(rem.back());
rem.pop_back();
}
Remove(x);
}
else{
rem.push_back(x);
}
}
Remove(Xpos);
for (auto x : rem){
Remove(x);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |