# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
931599 | lamter | Ancient Machine (JOI21_ancient_machine) | C++17 | 47 ms | 8464 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <bits/stdc++.h>
void Anna(int n, std::vector <char> a) {
bool found = 0;
for (int i = 0; i < n; i += 1) {
int bit = 0;
if (not found and a[i] == 'X') {
bit = 1;
found = true;
}
if (found and a[i] == 'Z') {
bit = 1;
}
Send(bit);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
void Bruno(int n, int l, std::vector <int> a) {
std::vector <int> posOne;
for (int i = 0; i < n; i += 1) if (a[i])
posOne.push_back(i);
if (posOne.size() < 2) {
for (int i = 0; i < n; i += 1)
Remove(i);
return;
}
int x = posOne[0];
for (int i = 0; i < x; i += 1) {
Remove(i);
}
for (int i = 0; i + 1 < (int) posOne.size(); i += 1) {
for (int j = posOne[i + 1] - 1; j > posOne[i]; j -= 1)
Remove(j);
Remove(posOne[i + 1]);
}
for (int j = posOne.back() + 1; j < n; j += 1) {
Remove(j);
}
Remove(x);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |