# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1071041 | 12345678 | Ancient Machine (JOI21_ancient_machine) | C++17 | 71 ms | 9660 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(0);
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
const int nx=1e5+5;
int t[nx], curx=-1;
void Bruno(int N, int L, std::vector<int> A) {
for (int i = 0; i < N; i++) t[i]=A[2*i]*2+A[2*i+1];
stack<pair<int, int>> s;
for (int i=0; i<N; i++)
{
if (t[i]==0)
{
if (curx==-1) curx=i;
else Remove(i);
}
if (t[i]==1)
{
//cout<<"curx "<<curx<<'\n';
if (curx!=-1) s.push({curx, i}), curx=-1;
else Remove(i);
}
if (t[i]==2)
{
if (!s.empty())
{
if (curx!=-1) Remove(curx);
while (!s.empty())
{
Remove(s.top().second);
if (s.size()==1) curx=s.top().first;
else Remove(s.top().first);
s.pop();
}
}
Remove(i);
}
}
if (curx!=-1) Remove(curx);
while (!s.empty()) Remove(s.top().first), Remove(s.top().second), s.pop();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |