Submission #882384

# Submission time Handle Problem Language Result Execution time Memory
882384 2023-12-03T06:06:38 Z willychan Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
57 ms 9796 KB
#include "Anna.h"
#include <vector>

namespace {

int variable_example = 0;

}

void Anna(int N, std::vector<char> S) {
	for(int i=0;i<N;i++){
		if(S[i]=='X'){
			Send(0);
			Send(0);
		}
		if(S[i]=='Y'){
			Send(0);
			Send(1);
		}
		if(S[i]=='Z'){
			Send(1);
			Send(0);
		}
	}
}
#include "Bruno.h"
#include <vector>
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) {
	vector<int> arr(N);
	for(int i=0;i<N;i++){
		int c = 2*A[2*i] + A[2*i+1];
		arr[i]=c;
	}
	vector<int> prev;
	for(int i=0;i<N;i++){
		if(prev.empty()){
			if(arr[i]==0){
				prev.push_back(i);
				continue;
			}
		}else if(arr[prev.back()]==0){
			if(arr[i]==1){
				prev.push_back(i);
				continue;
			}
		}else if(arr[prev.back()]==1){
			if(arr[i]==2){
				prev.push_back(i);
				Remove(prev[1]);
				Remove(prev[0]);
				Remove(prev[2]);
				prev.clear();
				continue;
			}
		}
		Remove(i);
	}
	for(auto i : prev) Remove(i);
}

Compilation message

Anna.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    6 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~

Bruno.cpp:9:5: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
    9 | int FunctionExample(int P) { return 1 - P; }
      |     ^~~~~~~~~~~~~~~
Bruno.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 780 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 57 ms 9796 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -