Submission #419710

# Submission time Handle Problem Language Result Execution time Memory
419710 2021-06-07T11:47:21 Z amoo_safar Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
75 ms 8388 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

void Anna(int _n, vector<char> S) {
	int fl = 0;
	for(auto c : S){
		int rs = 0;
		if(fl == 1 && c == 'Z') rs = 1;
		if(fl == 0 && c == 'X') fl = 1, 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 Correct 1 ms 496 KB Output is correct
2 Correct 1 ms 496 KB Output is correct
3 Correct 1 ms 488 KB Output is correct
4 Correct 1 ms 496 KB Output is correct
5 Correct 1 ms 496 KB Output is correct
6 Correct 1 ms 484 KB Output is correct
7 Correct 1 ms 496 KB Output is correct
8 Correct 1 ms 496 KB Output is correct
9 Correct 0 ms 488 KB Output is correct
10 Correct 1 ms 540 KB Output is correct
11 Correct 1 ms 488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 66 ms 8236 KB Partially correct
2 Partially correct 62 ms 8200 KB Partially correct
3 Partially correct 62 ms 8188 KB Partially correct
4 Partially correct 64 ms 8236 KB Partially correct
5 Partially correct 65 ms 8212 KB Partially correct
6 Partially correct 62 ms 8260 KB Partially correct
7 Partially correct 63 ms 8272 KB Partially correct
8 Partially correct 64 ms 8236 KB Partially correct
9 Partially correct 62 ms 8188 KB Partially correct
10 Partially correct 63 ms 8388 KB Partially correct
11 Partially correct 63 ms 8236 KB Partially correct
12 Partially correct 64 ms 8344 KB Partially correct
13 Partially correct 72 ms 8208 KB Partially correct
14 Partially correct 73 ms 8276 KB Partially correct
15 Partially correct 66 ms 8228 KB Partially correct
16 Partially correct 73 ms 8204 KB Partially correct
17 Partially correct 71 ms 8244 KB Partially correct
18 Partially correct 73 ms 8180 KB Partially correct
19 Partially correct 75 ms 8224 KB Partially correct
20 Partially correct 63 ms 8316 KB Partially correct
21 Partially correct 62 ms 8228 KB Partially correct
22 Partially correct 72 ms 8356 KB Partially correct
23 Partially correct 62 ms 8240 KB Partially correct
24 Partially correct 62 ms 8284 KB Partially correct
25 Partially correct 70 ms 8168 KB Partially correct
26 Partially correct 72 ms 8224 KB Partially correct
27 Partially correct 69 ms 8196 KB Partially correct
28 Partially correct 70 ms 8232 KB Partially correct
29 Partially correct 72 ms 8200 KB Partially correct
30 Partially correct 70 ms 8272 KB Partially correct
31 Partially correct 69 ms 8224 KB Partially correct
32 Partially correct 64 ms 8200 KB Partially correct
33 Partially correct 62 ms 8236 KB Partially correct