제출 #798374

#제출 시각아이디문제언어결과실행 시간메모리
798374ymmAncient Machine (JOI21_ancient_machine)C++17
70 / 100
47 ms8400 KiB
#include "Anna.h"
#include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (l); --x)
typedef long long ll;
using namespace std;

namespace {

int variable_example = 0;

}

void Anna(int N, std::vector<char> S) {
	int p = 0;
	while (p < N && S[p] != 'X')
		++p;
	if (p == N) {
		Loop (i,0,N)
			Send(0);
		return;
	}
	Loop (i,0,p)
		Send(0);
	Send(1);
	Loop (i,p+1,N)
		Send(S[i] == 'Z');
}
#include "Bruno.h"
#include <bits/stdc++.h>
#define Loop(x,l,r) for (ll x = (l); x < (r); ++x)
#define LoopR(x,l,r) for (ll x = (r)-1; x >= (l); --x)
typedef long long ll;
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) {
	int p = 0;
	while (p < N && !A[p])
		++p;
	if (p == N) {
		Loop (i,0,N)
			Remove(i);
		return;
	}
	int lst = p+1;
	Loop (p2,p+1,N) {
		if (!A[p2])
			continue;
		LoopR (j,lst,p2)
			Remove(j);
		Remove(p2);
		lst = p2+1;
	}
	Loop (i,0,p+1)
		Remove(i);
	Loop (i,lst,N)
		Remove(i);
}

컴파일 시 표준 에러 (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...