# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1071043 | ttamx | Ancient Machine (JOI21_ancient_machine) | C++17 | 56 ms | 8232 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 Anna(int n,vector<char> s){
char tar='X';
for(int i=0;i<n;i++){
if(s[i]==tar){
Send(1);
tar='Z';
}else{
Send(0);
}
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int n,int m,vector<int> a){
stack<int> s;
int p=-1;
for(int i=0;i<n;i++){
if(p==-1){
if(a[i]){
p=i;
}else{
Remove(i);
}
}else{
if(a[i]){
while(!s.empty()){
Remove(s.top());
s.pop();
}
Remove(i);
}else{
s.emplace(i);
}
}
}
while(!s.empty()){
Remove(s.top());
s.pop();
}
if(p!=-1){
Remove(p);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |