Submission #419722

# Submission time Handle Problem Language Result Execution time Memory
419722 2021-06-07T11:55:50 Z amoo_safar Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
62 ms 7868 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

void Anna(int _n, vector<char> S){
	
	int fl = 0, fly = 0;
	for(auto c : S){
		int rs = 0;
		if(c == 'Y') fly = 1;
		if(fl == 1 && fly == 1 && c == 'Z') rs = 1, fly = 0;
		if(fl == 0 && c == 'X') fl = 1, fly = 0, rs = 1;
		Send(rs);
	}
}
#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;

void Bruno(int _n, int L, vector<int> A) {
	int cnt = 0;
	vector<int> mk(_n, 0);
	for (int i = 0; i < L; i++) {
		if(A[i] == 1){
			cnt ++;
			for(int j = i - 1; j >= 0; j--){
				if(A[j] == 1) break;
				Remove(j);
				mk[j] = 1;
			}
			if(cnt != 1){
				Remove(i);
				mk[i] = 1;
			}
		}
	}
	for(int i = 0; i < _n; i++) if(!mk[i]) Remove(i);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 484 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 62 ms 7868 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -