# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1071122 | 12345678 | Ancient Machine (JOI21_ancient_machine) | C++17 | 61 ms | 9892 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
void Anna(int N, std::vector<char> S) {
while ((S.size()%5)!=0) S.push_back('X');
vector<int> pw(10);
pw[0]=1;
for (int i=1; i<10; i++) pw[i]=pw[i-1]*3;
for (int i=0; i<S.size(); i+=5)
{
int tmp=0;
for (int j=0; j<5; j++) tmp+=(S[i+j]-'X')*pw[j];
for (int j=0; j<8; j++) Send(((tmp&(1<<j))>0));
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
const int nx=1e5+5;
int t[nx+20], curx=-1, cnt=0;
void Bruno(int N, int L, std::vector<int> A) {
for (int i=0; i<L; i+=8)
{
int tmp=0;
for (int j=0; j<8; j++) if (A[i+j]) tmp+=(1<<j);
for (int j=0; j<5; j++) t[cnt++]=tmp%3, tmp/=3;
}
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)
{
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();
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |