Submission #1008311

# Submission time Handle Problem Language Result Execution time Memory
1008311 2024-06-26T09:09:49 Z IBory Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
37 ms 8420 KB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;

void Anna(int N, vector<char> S) {
	int x = -1, y = -1, z = -1;
	vector<int> go(N);
	for (int i = 0; i < N; ++i) {
		if (x == -1) {
			if (S[i] == 'X') x = i;
		}
		else if (y == -1) {
			if (S[i] == 'X') x = i;
			if (S[i] == 'Y') y = i;
		}
		else if (z == -1) {
			if (S[i] == 'Z') {
				go[x] = go[y] = go[i] = 1;
				x = y = z = -1;
			}
		}
	}
	for (int n : go) Send(n);
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;

void Bruno(int N, int L, vector<int> A) {
	vector<int> P;
	for (int i = 0; i < A.size(); ++i) {
		if (A[i]) P.push_back(i);
		else Remove(i);
	}
	for (int i = 1; i < P.size(); i += 3) Remove(P[i]);
	for (int i = 0; i < P.size(); ++i) if (i % 3 != 1) Remove(P[i]);
}

Compilation message

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:7:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |  for (int i = 0; i < A.size(); ++i) {
      |                  ~~^~~~~~~~~~
Bruno.cpp:11:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |  for (int i = 1; i < P.size(); i += 3) Remove(P[i]);
      |                  ~~^~~~~~~~~~
Bruno.cpp:12:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for (int i = 0; i < P.size(); ++i) if (i % 3 != 1) Remove(P[i]);
      |                  ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 780 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 8420 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -