Submission #1182007

#TimeUsernameProblemLanguageResultExecution timeMemory
1182007_sixtyfourAncient Machine (JOI21_ancient_machine)C++20
0 / 100
53 ms6456 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; void Anna(int N, vector<char> S) { vector<int> bits(N); bool first_x = true; for(int i = 0; i < N; i++) { if(first_x && S[i] == 'X') bits[i] = 1, first_x = false; else if(S[i] == 'Z' && (i + 1 == N || S[i + 1] != 'Z')) bits[i] = 1; else bits[i] = 0; } for(int i = 0; i < N; i++) Send(bits[i]); }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; void Bruno(int N, int L, vector<int> A) { int i_x = 0; for(int i = 0; i < N; i++) { if(A[i] == 1) { i_x = i; break; } Remove(i); } int l = i_x; for(int i = i_x + 1; i < N; i++) { if(A[i] == 1) { int j = i - 1; while(j > l) { Remove(j); j--; } Remove(i); l = i; } } for(int i = l + 1; i < N; i++) Remove(i); Remove(i_x); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...