제출 #547991

#제출 시각아이디문제언어결과실행 시간메모리
547991SamNguyenAncient Machine (JOI21_ancient_machine)C++17
0 / 100
10 ms2016 KiB
#include "Anna.h" #include <vector> #include <iostream> #include <math.h> using namespace std; void Anna(int N, vector<char> S) { const int MAX_BIT = log2(N - 1); char target = 'X'; for (int i = 0; i < N; target = target ^ 'X' ^ 'Z') { int j = i; while (j < N and S[j] != target) j++; if (j >= N) break; for (int x = 0; x <= MAX_BIT; x++) Send((j >> x) & 1); i = j + 1; } }
#include "Bruno.h" #include <vector> #include <string> #include <cstring> #include <iostream> #include <bitset> #include <math.h> using namespace std; namespace { } void Bruno(int N, int L, std::vector<int> A) { const int MAX_BIT = log2(N - 1); vector<int> check_points = {-1}; for (int i = 0; i < L; i += MAX_BIT + 1) { int x = 0; for (int j = 0; j <= MAX_BIT; j++) x |= A[i + j] << j; check_points.push_back(x); } check_points.push_back(N); for (int i = 0; i < (int)check_points.size(); i++) for (int j = check_points[i] - 1; j > check_points[i - 1]; j--) Remove(j); for (int i : check_points) if (i >= 0 and i < N) Remove(i); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...