# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
712601 | tht2005 | Ancient Machine (JOI21_ancient_machine) | C++17 | 92 ms | 10236 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <vector>
void Anna(int N, std::vector<char> S) {
for(int i = 0; i < N; ++i) {
if(S[i] == 'X') {
Send(0);
}
else if(S[i] == 'Y') {
Send(0);
}
else {
Send(1);
}
}
for(int i = 0; i < N; ++i) {
if(S[i] == 'X') {
Send(0);
}
else if(S[i] == 'Y') {
Send(1);
}
else {
Send(0);
}
}
}
#include "Bruno.h"
#include <vector>
void Bruno(int N, int L, std::vector<int> A) {
std::vector<int> S(N);
for(int i = 0; i < N; ++i) {
S[i] = (A[i] << 1) | A[N + i];
}
int first_X = 0;
while(first_X < N && S[first_X] > 0) {
++first_X;
}
std::vector<int> stk;
for(int i = 0; i < first_X; ++i) {
Remove(i);
}
for(int i = first_X; i < N; ++i) {
if(S[i] == 1) {
while(!stk.empty() && S[stk.back()] > 0) {
Remove(stk.back());
stk.pop_back();
}
}
else if(S[i] == 2) {
while(!stk.empty() && first_X < stk.back()) {
Remove(stk.back());
stk.pop_back();
}
}
stk.push_back(i);
}
for(int i : stk) {
Remove(i);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |