제출 #947166

#제출 시각아이디문제언어결과실행 시간메모리
947166siewjhAncient Machine (JOI21_ancient_machine)C++17
70 / 100
62 ms8468 KiB
#include "Anna.h" #include <bits/stdc++.h> using namespace std; namespace { } void Anna(int N, vector<char> S) { bool active = 0; for (int i = 0; i < N; i++){ if (S[i] == 'X'){ Send(!active); active = 1; } else if (S[i] == 'Y') Send(0); else Send(active); } }
#include "Bruno.h" #include <bits/stdc++.h> using namespace std; namespace { } // namespace void Bruno(int N, int L, vector<int> A) { int prv = 0, fx = -1; for (int i = 0; i < N; i++){ if (A[i]){ if (fx == -1){ fx = i; prv = i + 1; } else{ for (int j = i - 1; j >= prv; j--) Remove(j); Remove(i); prv = i + 1; } } } for (int i = 0; i <= fx; i++) Remove(i); for (int i = prv; i < N; i++) Remove(i); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...