Submission #710420

#TimeUsernameProblemLanguageResultExecution timeMemory
710420lmqzzzAncient Machine (JOI21_ancient_machine)C++17
70 / 100
68 ms8136 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; void Anna(int N, std::vector<char> S) { int last = -1; for (int i = 0; i < N; i++) { if (last == -1 && S[i] == 'X') { Send(1); last = i; } else if (last == -1) { Send(0); } else if (S[i] == 'Z') { Send(1); } else { Send(0); } } }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; void Bruno(int N, int L, std::vector<int> A) { int last = -1; for (int i = 0; i < L; i++) { if (A[i]) { if (last != -1) { for (int j = i - 1; j > last; j--) Remove(j); Remove(i); } last = i; } } int i = 0; while (i < N && A[i] == 0) Remove(i++); if (i == N) return; Remove(i); i = last + 1; while (i < N) Remove(i++); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...