Submission #800062

# Submission time Handle Problem Language Result Execution time Memory
800062 2023-08-01T09:40:16 Z Sohsoh84 Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
49 ms 8200 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++;
	bool flag = true;
	int tflagind = -1;

	vector<int> ans;
	for (int i = 0; i < N; i++) {
		if (S[i] == 'X') flag = false;
		ans.push_back(flag || S[i] == 'Z');

		if (flag) tflagind = i;
	}

	for (int i = 0; i < tflagind; i++)
		ans[i] = 0;

	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> A) {	
	if (!L) {
		for (int i = 0; i < N; i++)
			Remove(i);

		return;
	}

	stack<int> st;
	for (int i = 0; i < L; 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

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 Incorrect 0 ms 516 KB Wrong Answer [6]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 40 ms 8060 KB Partially correct
2 Partially correct 44 ms 8200 KB Partially correct
3 Partially correct 49 ms 8160 KB Partially correct
4 Incorrect 40 ms 8084 KB Wrong Answer [6]
5 Halted 0 ms 0 KB -