Submission #800072

# Submission time Handle Problem Language Result Execution time Memory
800072 2023-08-01T09:47:36 Z Sohsoh84 Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
46 ms 8496 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

namespace {
	int variable_example = 0;
}

void Anna(int N, vector<char> S) {
	variable_example++;
	int tflagind = -1;

	vector<int> ans = {0};
	for (int i = 1; i < N; i++) {
		ans.push_back(S[i - 1] == 'Z');
	}

	int ind = 0;
	while (S[ind] != 'X' && ind < N) ind++;
	if (ind == N) return;

	for (int i = 0; i <= ind; i++) ans[i] = 0;
	ans[ind] = 1;
		
	for (int e : ans)
		Send(e);
}


#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;

namespace {

	int variable_example = 0;

	int FunctionExample(int P) { return 1 - P; }

}  // namespace

void Bruno(int N, int L, std::vector<int> TA) {	
	if (!L) {
		for (int i = 0; i < N; i++)
			Remove(i);

		return;
	}

	int ind = 0;
	vector<int> A(N);
	while (!TA[ind]) ind++;

	for (int i = 0; i < ind; i++)
		A[i] = 1;

	A[N - 1] = 1;
	for (int i = ind + 1; i < N; i++)
		A[i - 1] = TA[i];

	stack<int> st;
	bool flag = false;

	for (int i = 0; i < N; i++) {	
		if (A[i]) {
			while (st.size() > 1) {
				Remove(st.top());
				st.pop();
			}

			Remove(i);
		} else st.push(i);
	}

	while (!st.empty()) {
		Remove(st.top());
		st.pop();
	}
}


Compilation message

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:12:6: warning: unused variable 'tflagind' [-Wunused-variable]
   12 |  int tflagind = -1;
      |      ^~~~~~~~

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:34:7: warning: unused variable 'flag' [-Wunused-variable]
   34 |  bool flag = false;
      |       ^~~~
Bruno.cpp: At global scope:
Bruno.cpp:10:6: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
   10 |  int FunctionExample(int P) { return 1 - P; }
      |      ^~~~~~~~~~~~~~~
Bruno.cpp:8:6: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    8 |  int variable_example = 0;
      |      ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 508 KB Output is correct
2 Correct 0 ms 508 KB Output is correct
3 Correct 0 ms 516 KB Output is correct
4 Correct 0 ms 508 KB Output is correct
5 Correct 0 ms 508 KB Output is correct
6 Correct 0 ms 508 KB Output is correct
7 Correct 0 ms 516 KB Output is correct
8 Correct 0 ms 516 KB Output is correct
9 Correct 1 ms 580 KB Output is correct
10 Correct 0 ms 552 KB Output is correct
11 Correct 0 ms 508 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 40 ms 8384 KB Partially correct
2 Partially correct 46 ms 8388 KB Partially correct
3 Partially correct 40 ms 8364 KB Partially correct
4 Partially correct 40 ms 8380 KB Partially correct
5 Partially correct 43 ms 8420 KB Partially correct
6 Partially correct 39 ms 8404 KB Partially correct
7 Partially correct 39 ms 8460 KB Partially correct
8 Partially correct 40 ms 8356 KB Partially correct
9 Partially correct 40 ms 8404 KB Partially correct
10 Partially correct 40 ms 8384 KB Partially correct
11 Partially correct 39 ms 8384 KB Partially correct
12 Partially correct 40 ms 8360 KB Partially correct
13 Partially correct 38 ms 8352 KB Partially correct
14 Partially correct 45 ms 8384 KB Partially correct
15 Partially correct 42 ms 8296 KB Partially correct
16 Partially correct 43 ms 8284 KB Partially correct
17 Partially correct 38 ms 8292 KB Partially correct
18 Correct 36 ms 6988 KB Output is correct
19 Correct 32 ms 7108 KB Output is correct
20 Partially correct 39 ms 8416 KB Partially correct
21 Partially correct 42 ms 8360 KB Partially correct
22 Partially correct 40 ms 8316 KB Partially correct
23 Partially correct 38 ms 8416 KB Partially correct
24 Partially correct 38 ms 8340 KB Partially correct
25 Correct 33 ms 7032 KB Output is correct
26 Partially correct 38 ms 8396 KB Partially correct
27 Partially correct 45 ms 8316 KB Partially correct
28 Partially correct 38 ms 8496 KB Partially correct
29 Correct 33 ms 7140 KB Output is correct
30 Partially correct 46 ms 8284 KB Partially correct
31 Correct 33 ms 7076 KB Output is correct
32 Partially correct 43 ms 8280 KB Partially correct
33 Partially correct 39 ms 8436 KB Partially correct