답안 #935480

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
935480 2024-02-29T07:52:53 Z SmuggingSpun Ancient Machine (JOI21_ancient_machine) C++17
30 / 100
61 ms 10196 KB
#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
void Anna(int n, vector<char>S){
	for(char& c : S){
		if(c == 'X'){
			Send(0);
			Send(0);
		}
		else if(c == 'Y'){
			Send(1);
			Send(0);
		}
		else{
			Send(0);
			Send(1);
		}
	}
}
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
void Bruno(int n, int sz_a, vector<int>A){
	const int X = 0, Y = 1, Z = 2;
	vector<int>a(n);
	for(int i = 0; i < sz_a; i += 2){
		a[i >> 1] = A[i] + (A[i + 1] << 1);
	}
	int ptr = n - 1;
	while(ptr > -1 && a[ptr] != Z){
		Remove(ptr--);
	}
	if(ptr > -1){
		int last = ptr--;
		while(ptr > -1){
			int r_ptr = ptr;
			while(ptr > -1 && a[ptr] != X){
				ptr--;
			}
			for(int i = ptr + 1; i <= r_ptr; i++){
				Remove(i);
			}
			while(ptr > -1 && a[ptr] == X){
				Remove(ptr--);
			}
		}
		Remove(last);
	}
}

Compilation message

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:5:19: warning: unused variable 'Y' [-Wunused-variable]
    5 |  const int X = 0, Y = 1, Z = 2;
      |                   ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 792 KB Output is correct
2 Correct 1 ms 1048 KB Output is correct
3 Correct 0 ms 796 KB Output is correct
4 Correct 1 ms 784 KB Output is correct
5 Correct 0 ms 780 KB Output is correct
6 Correct 0 ms 784 KB Output is correct
7 Correct 1 ms 796 KB Output is correct
8 Correct 1 ms 796 KB Output is correct
9 Correct 0 ms 784 KB Output is correct
10 Correct 0 ms 1188 KB Output is correct
11 Correct 1 ms 784 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 53 ms 9528 KB Partially correct
2 Partially correct 53 ms 9604 KB Partially correct
3 Partially correct 55 ms 10052 KB Partially correct
4 Partially correct 53 ms 9972 KB Partially correct
5 Partially correct 53 ms 10068 KB Partially correct
6 Partially correct 54 ms 10112 KB Partially correct
7 Partially correct 57 ms 10148 KB Partially correct
8 Partially correct 53 ms 9976 KB Partially correct
9 Partially correct 53 ms 10000 KB Partially correct
10 Partially correct 53 ms 10000 KB Partially correct
11 Partially correct 53 ms 9880 KB Partially correct
12 Partially correct 53 ms 9984 KB Partially correct
13 Partially correct 58 ms 10016 KB Partially correct
14 Partially correct 60 ms 10008 KB Partially correct
15 Partially correct 54 ms 10040 KB Partially correct
16 Partially correct 55 ms 9996 KB Partially correct
17 Partially correct 57 ms 9976 KB Partially correct
18 Partially correct 59 ms 9832 KB Partially correct
19 Partially correct 58 ms 9984 KB Partially correct
20 Partially correct 52 ms 9956 KB Partially correct
21 Partially correct 52 ms 10052 KB Partially correct
22 Partially correct 58 ms 10056 KB Partially correct
23 Partially correct 53 ms 10036 KB Partially correct
24 Partially correct 56 ms 9984 KB Partially correct
25 Partially correct 59 ms 10000 KB Partially correct
26 Partially correct 58 ms 10012 KB Partially correct
27 Partially correct 58 ms 9980 KB Partially correct
28 Partially correct 61 ms 10032 KB Partially correct
29 Partially correct 59 ms 10196 KB Partially correct
30 Partially correct 61 ms 10044 KB Partially correct
31 Partially correct 58 ms 9856 KB Partially correct
32 Partially correct 61 ms 10020 KB Partially correct
33 Partially correct 53 ms 10160 KB Partially correct