# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
712616 | dungnguyenn_05 | Ancient Machine (JOI21_ancient_machine) | C++17 | 38 ms | 4088 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include <vector>
#include "Anna.h"
void Anna(int N, std::vector<char> S) {
for(char c:S)
{
if(c=='X')
{
Send(0);
Send(0);
}
if(c=='Y')
{
Send(0);
Send(1);
}
if(c=='Z')
{
Send(1);
Send(0);
}
}
}
#include<bits/stdc++.h>
#include <vector>
#include "Bruno.h"
using namespace std;
char ch[200005];
void Bruno(int N, int L, std::vector<int> A) {
stack<char> st;
int cnt=0;
bool ok=0;
for(int i=0;i<A.size();i+=2)
{
int d=A[i];
int c=A[i+1];
if(!d and !c)
ch[cnt]='X';
if(!d and c)
ch[cnt]='Y';
if(d and !c)
ch[cnt]='Z';
if(ch[cnt]=='X')
ok=1;
if(!ok)
{
Remove(cnt);
cnt++;
continue;
}
while(st.size() and st.top()==ch[cnt])
{
Remove(st.top());
st.pop();
}
if(ch[cnt]=='X' or ch[cnt]=='Y')
st.push(cnt);
if(ch[cnt]=='Z')
{
if(ch[st.top()]=='X')
{
if(st.size()>1)
{
Remove(st.top());
st.pop();
}
else
{
Remove(cnt);
cnt++;
continue;
}
}
while(st.size()>2)
{
Remove(st.top());
st.pop();
Remove(st.top());
st.pop();
}
if(st.size()==2)
{
Remove(st.top());
st.pop();
}
Remove(cnt);
}
cnt++;
}
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... |