Submission #709623

# Submission time Handle Problem Language Result Execution time Memory
709623 2023-03-14T03:31:43 Z lmqzzz Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
8 ms 1848 KB
#include "Anna.h"

#include <bits/stdc++.h>
using namespace std;
void send(int x) {
        bitset<17> a(x);
        for (int i = 0; i < 17; i++) Send(a[i]);
}

void Anna(int N, std::vector<char> S) {
        string temp = "XYZ";
        int j = 0;
        for (int i = 0; i < N; i++) {
                if (S[i] == temp[j]) {
                        j++;
                        j %= 3;
                        send(i);
                }
        }
}
#include "Bruno.h"

#include <bits/stdc++.h>
using namespace std;
int a[100001];

void Bruno(int N, int L, std::vector<int> A) {
        assert(L % 17 == 0);
        vector<int> v;
        for (int i = 0; i < L; i += 17) {
                int pos = 0;
                for (int j = i; j < i + 17; j++) {
                        if (A[j]) pos |= 1 << (j - i);
                }
                v.emplace_back(pos);
                a[pos] = 1;
        }
        for (int i = 0; i < N; i++)
                if (a[i] == 0) Remove(i);
        for (int i = 1; i < v.size(); i += 3) {
                Remove(v[i]);
        }
        for (int i = 0; i < v.size(); i++) {
                if (i % 3 == 1) continue;
                Remove(v[i]);
        }
}

Compilation message

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:20:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |         for (int i = 1; i < v.size(); i += 3) {
      |                         ~~^~~~~~~~~~
Bruno.cpp:23:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         for (int i = 0; i < v.size(); i++) {
      |                         ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 516 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 1848 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -