Submission #709623

#TimeUsernameProblemLanguageResultExecution timeMemory
709623lmqzzzAncient Machine (JOI21_ancient_machine)C++17
0 / 100
8 ms1848 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...