# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1071166 | thinknoexit | Ancient Machine (JOI21_ancient_machine) | C++17 | 49 ms | 9792 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
namespace {
int n;
}
void Anna(int N, vector<char> S) {
n = N;
for (int i = 0;i < n;i++) {
int v = S[i] - 'X';
Send(!!(v & 1));
Send(!!(v & 2));
}
}
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
namespace {
int n;
int a[100100], pos[100100];
bool ch[100100];
} // namespace
void Bruno(int N, int L, vector<int> A) {
n = N;
for (int i = 0;i < n;i++) {
a[i] = A[2 * i] + 2 * A[2 * i + 1];
}
stack<int> st;
for (int i = 0;i < n;i++) {
pos[i] = -1;
if (a[i] == 2) continue;
if (a[i] == 0) st.push(i);
else {
if (st.empty()) Remove(i);
else {
pos[i] = st.top();
st.pop();
}
}
}
while (!st.empty()) {
Remove(st.top());
st.pop();
}
for (int i = 0;i < n;i++) {
if (pos[i] != -1) {
while (!st.empty() && pos[st.top()] > pos[i]) {
Remove(st.top());
Remove(pos[st.top()]);
st.pop();
}
st.push(i);
continue;
}
if (a[i] == 0 || a[i] == 1) continue;
if (!st.empty()) {
Remove(st.top());
Remove(pos[st.top()]);
st.pop();
}
Remove(i);
}
while (!st.empty()) {
Remove(st.top());
Remove(pos[st.top()]);
st.pop();
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |