# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
537755 | Jarif_Rahman | Ancient Machine (JOI21_ancient_machine) | C++17 | 79 ms | 8600 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 pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
namespace {
}
void Anna(int n, vector<char> s){
vector<int> rt(n, 0);
int fx = -1;
for(int i = 0; i < n; i++) if(s[i] == 'X'){
fx = i;
break;
}
if(fx == -1){
for(int x: rt) Send(x);
return;
}
rt[fx] = 1;
for(int i = fx+1; i < n; i++) if(s[i] == 'Z') rt[i] = 1;
for(int x: rt) Send(x);
}
#include "Bruno.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
namespace {
}
void Bruno(int n, int m, vector<int> A){
int fx = -1;
for(int i = 0; i < n; i++) if(A[i] == 1){
fx = i;
break;
}
if(fx == -1){
for(int i = 0; i < n; i++) Remove(i);
return;
}
for(int i = 0; i < fx; i++) Remove(i);
int ls = fx+1;
for(int i = fx+1; i < n; i++){
if(A[i] != 1) continue;
for(int j = i-1; j >= ls; j--) Remove(j);
Remove(i);
ls = i+1;
}
Remove(fx);
for(int i = ls; i < n; i++) Remove(i);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |