Submission #947165

# Submission time Handle Problem Language Result Execution time Memory
947165 2024-03-15T15:19:35 Z siewjh Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
48 ms 8472 KB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;

namespace {
}

void Anna(int N, vector<char> S) {
	bool active = 0;
	for (int i = 0; i < N; i++){
		if (S[i] == 'X'){
			Send(!active);
			active = 1;
		}
		else if (S[i] == 'Y') Send(0);
		else Send(active);
	}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;

namespace {
}  // namespace

void Bruno(int N, int L, vector<int> A) {
	int prv, fx = -1;
	for (int i = 0; i < N; i++){
		if (A[i]){
			if (fx == -1){
				fx = i; prv = i + 1;
			}
			else{
				for (int j = i - 1; j >= prv; j--) Remove(j);
				Remove(i);
				prv = i + 1;
			}
		}
	}
	for (int i = 0; i <= fx; i++) Remove(i);
	for (int i = prv; i < N; i++) Remove(i);
}

Compilation message

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:23:2: warning: 'prv' may be used uninitialized in this function [-Wmaybe-uninitialized]
   23 |  for (int i = prv; i < N; i++) Remove(i);
      |  ^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 780 KB Output is correct
2 Correct 0 ms 828 KB Output is correct
3 Correct 0 ms 788 KB Output is correct
4 Correct 1 ms 780 KB Output is correct
5 Correct 1 ms 1204 KB Output is correct
6 Correct 1 ms 796 KB Output is correct
7 Correct 0 ms 788 KB Output is correct
8 Correct 0 ms 796 KB Output is correct
9 Correct 0 ms 784 KB Output is correct
10 Incorrect 0 ms 796 KB Wrong Answer [5]
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 40 ms 8232 KB Partially correct
2 Partially correct 40 ms 8288 KB Partially correct
3 Partially correct 44 ms 8304 KB Partially correct
4 Partially correct 40 ms 8472 KB Partially correct
5 Partially correct 47 ms 8248 KB Partially correct
6 Partially correct 40 ms 8460 KB Partially correct
7 Partially correct 40 ms 8360 KB Partially correct
8 Partially correct 40 ms 8376 KB Partially correct
9 Partially correct 40 ms 8464 KB Partially correct
10 Partially correct 41 ms 8440 KB Partially correct
11 Partially correct 40 ms 8432 KB Partially correct
12 Partially correct 40 ms 8424 KB Partially correct
13 Partially correct 47 ms 8464 KB Partially correct
14 Partially correct 48 ms 8260 KB Partially correct
15 Partially correct 41 ms 8340 KB Partially correct
16 Partially correct 43 ms 8384 KB Partially correct
17 Partially correct 45 ms 8364 KB Partially correct
18 Incorrect 17 ms 3108 KB Wrong Answer [5]
19 Halted 0 ms 0 KB -