# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427504 | Osama_Alkhodairy | Ancient Machine (JOI21_ancient_machine) | C++17 | 88 ms | 9072 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 <bits/stdc++.h>
#include "Anna.h"
using namespace std;
void Anna(int N, std::vector<char> S) {
int firstX = N;
for(int i = 0 ; i < N ; i++){
if(S[i] == 'X'){
firstX = i;
break;
}
}
int lastZ = N;
for(int i = N - 1 ; i >= 0 ; i--){
if(S[i] == 'Z'){
lastZ = i;
break;
}
}
for(int i = 16 ; i >= 0 ; i--){
Send((firstX >> i) & 1);
}
for(int i = 16 ; i >= 0 ; i--){
Send((lastZ >> i) & 1);
}
vector <int> f(N);
for(int i = firstX + 1 ; i < lastZ ; i++){
if(S[i] == 'Y' && S[i - 1] != 'Y'){
f[i] = 1;
if(S[i - 1] == 'Z') f[i - 1] = 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |