# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1010909 | Unforgettablepl | Ancient Machine (JOI21_ancient_machine) | C++17 | 50 ms | 8356 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>
#include <bits/stdc++.h>
using namespace std;
namespace {
}
void Anna(int N, std::vector<char> S) {
bool foundX = false;
S.emplace_back('$');
for(int i=0;i<N;i++){
if(S[i]=='X'){
if(foundX)Send(0);
else {
foundX = true;
Send(1);
}
} else if(S[i]=='Y'){
Send(0);
} else if(S[i]=='Z'){
if(!foundX or S[i+1]=='Z')Send(0);
else Send(1);
}
}
}
#include "Bruno.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
namespace {
} // namespace
void Bruno(int N, int L, std::vector<int> A) {
vector<bool> vis(N);
vector<int> po;
for(int i=0;i<N;i++){
if(A[i]==1)po.emplace_back(i);
}
for(int x=1;x<po.size();x++){
for(int i=po[x]-1;i>po[x-1];i--){
Remove(i);
vis[i]=true;
}
vis[po[x]]=true;
Remove(po[x]);
}
for(int i=0;i<N;i++)if(!vis[i])Remove(i);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |