답안 #574689

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
574689 2022-06-09T09:02:18 Z Arvin Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
78 ms 8316 KB
#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);
	}
}

Compilation message

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;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 512 KB Output is correct
2 Correct 1 ms 520 KB Output is correct
3 Correct 1 ms 520 KB Output is correct
4 Correct 1 ms 520 KB Output is correct
5 Correct 2 ms 608 KB Output is correct
6 Correct 2 ms 520 KB Output is correct
7 Correct 2 ms 520 KB Output is correct
8 Correct 1 ms 580 KB Output is correct
9 Correct 2 ms 512 KB Output is correct
10 Correct 2 ms 600 KB Output is correct
11 Correct 2 ms 524 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 56 ms 8216 KB Partially correct
2 Partially correct 65 ms 8264 KB Partially correct
3 Partially correct 56 ms 8268 KB Partially correct
4 Partially correct 57 ms 8276 KB Partially correct
5 Partially correct 56 ms 8300 KB Partially correct
6 Partially correct 61 ms 8192 KB Partially correct
7 Partially correct 60 ms 8200 KB Partially correct
8 Partially correct 65 ms 8252 KB Partially correct
9 Partially correct 54 ms 8240 KB Partially correct
10 Partially correct 59 ms 8228 KB Partially correct
11 Partially correct 69 ms 8228 KB Partially correct
12 Partially correct 59 ms 8316 KB Partially correct
13 Partially correct 66 ms 8212 KB Partially correct
14 Partially correct 68 ms 8256 KB Partially correct
15 Partially correct 64 ms 8216 KB Partially correct
16 Partially correct 66 ms 8240 KB Partially correct
17 Partially correct 65 ms 8236 KB Partially correct
18 Partially correct 61 ms 8212 KB Partially correct
19 Partially correct 69 ms 8200 KB Partially correct
20 Partially correct 67 ms 8256 KB Partially correct
21 Partially correct 67 ms 8216 KB Partially correct
22 Partially correct 62 ms 8288 KB Partially correct
23 Partially correct 59 ms 8236 KB Partially correct
24 Partially correct 71 ms 8228 KB Partially correct
25 Partially correct 62 ms 8232 KB Partially correct
26 Partially correct 78 ms 8128 KB Partially correct
27 Partially correct 63 ms 8300 KB Partially correct
28 Partially correct 62 ms 8224 KB Partially correct
29 Partially correct 60 ms 8208 KB Partially correct
30 Partially correct 67 ms 8236 KB Partially correct
31 Partially correct 66 ms 8252 KB Partially correct
32 Partially correct 64 ms 8228 KB Partially correct
33 Partially correct 55 ms 8284 KB Partially correct