# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
709639 | lmqzzz | Ancient Machine (JOI21_ancient_machine) | C++17 | 92 ms | 9332 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
void Anna(int N, std::vector<char> S) {
for (int i = 0; i < N; i++) {
if (S[i] == 'X') Send(0), Send(0);
if (S[i] == 'Y') Send(0), Send(1);
if (S[i] == 'Z') Send(1), Send(1);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
string s = "";
for (int i = 0; i < L; i += 2) {
if (A[i] + A[i + 1] == 0) s += 'X';
if (A[i] + A[i + 1] == 1) s += 'Y';
if (A[i] + A[i + 1] == 2) s += 'Z';
}
int firstX = s.size();
for (int i = 0; i < s.size(); i++) {
if (s[i] == 'X') {
firstX = i;
break;
}
}
int lastZ = firstX;
for (int i = s.size() - 1; i > firstX; i--) {
if (s[i] == 'Z') {
lastZ = i;
break;
}
}
for (int i = 0; i < firstX; i++) Remove(i);
for (int i = s.size() - 1; i > lastZ; i--) Remove(i);
stack<int> st;
if (firstX < N) st.push(firstX);
for (int i = firstX + 1; i <= lastZ; i++) {
if (s[st.top()] == 'X') {
if (s[i] == 'X') Remove(i);
if (s[i] == 'Y') st.push(i);
if (s[i] == 'Z') {
while (st.size() > 1) Remove(st.top()), st.pop();
Remove(i);
}
} else if (s[st.top()] == 'Y') {
if (s[i] == 'X') st.push(i);
if (s[i] == 'Y') Remove(i);
if (s[i] == 'Z') {
while (st.size() > 1) Remove(st.top()), st.pop();
Remove(i);
}
} else {
assert(0);
}
}
while (st.size()) Remove(st.top()), st.pop();
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |