제출 #574689

#제출 시각아이디문제언어결과실행 시간메모리
574689ArvinAncient Machine (JOI21_ancient_machine)C++17
70 / 100
78 ms8316 KiB
#include "Anna.h"
#include <bits/stdc++.h>
	
using namespace std;
	
#define ll long long
	
namespace {
	
int variable_example = 0;
	
}
	
void Anna(int N, std::vector<char> S) {
	// 1 as store this first X or any Z after first Xa
	// 0 otherwise

	bool fX = false;
	for(int x=0;x<N;x++){
		if(S[x] == 'Z'){
			Send(fX);
		} else if(S[x] == 'Y'){ // XYXYZYZYZYZ (occurences of X are always first than Y)
			Send(0);
		} else if(S[x] == 'X'){
			if(!fX){
				Send(1);
				fX = true;
			} else {
				Send(0);
			}
		}
	}
}
#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;

#define ll long long

namespace {

int variable_example = 0;

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

}  // namespace

void Bruno(int N, int L, std::vector<int> A) {
//	for (int i = 0; i < L; i++) {
//	variable_example += FunctionExample(A[i]);
//	}
	assert(L <= N);

	vector<int> ans;
	int pos = -1, lst = 0;
	for(int x=0;x<L;x++){
		if(A[x] == 1){
			if(pos == -1){
				pos = x;
				lst = x+1;
			} else {
				for(int y=x-1;y>=lst;y--){
					ans.push_back(y);
				}
				ans.push_back(x);
				lst = x+1;
			}
		}
	}
	
	for(int x=0;x<=pos;x++){
		ans.push_back(x);
	}
	for(int x=lst;x<N;x++){
		ans.push_back(x);
	}

	for(auto val : ans){
		// cout << "- " << val << "\n";
		Remove(val);
	}
}

컴파일 시 표준 에러 (stderr) 메시지

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

Bruno.cpp:12:5: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
   12 | int FunctionExample(int P) { return 1 - P; }
      |     ^~~~~~~~~~~~~~~
Bruno.cpp:10:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   10 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...