# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
496268 | minhcool | Ancient Machine (JOI21_ancient_machine) | C++17 | 60 ms | 8396 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;
//#define int long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foru(i, l, r) for(int i = l; i <= r; i++)
#define ford(i, r, l) for(int i = r; i >= l; i--)
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
//const int oo = 1e18 + 7, mod = 1e9 + 7;
int ret[100005];
void Anna(int n, vector<char> S){
int need = 0, occ = 0, pos = -1;
for(int i = n - 1; i >= 0; i--){
if(S[i] == 'Z' && !occ){
occ = 1;
pos = i;
ret[i] = 1;
}
else if(S[i] == 'X' && occ && (!i || S[i - 1] != 'X')){
ret[i] = 1;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |