# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
417133 | tqbfjotld | Ancient Machine (JOI21_ancient_machine) | C++17 | 82 ms | 8040 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <vector>
using namespace std;
///17 bits for 1st X, N bits for isZ
void Anna(int N, std::vector<char> S) {
int Xpos = -1;
int Zpos = -1;
for (int x = 0; x<N; x++){
if (S[x]=='Z') Zpos = x;
if (Xpos==-1 && S[x]=='X') Xpos = x;
}
for (int x = 16; x>=0; x--){
Send((bool)(Xpos&(1<<x)));
}
for (int x = 0; x<N; x++){
Send(S[x]=='Z');
}
}
#include "Bruno.h"
#include <vector>
#include <cassert>
using namespace std;
void Bruno(int N, int L, std::vector<int> A) {
assert(L==N+17);
int Xpos = 0;
int Zpos = 0;
for (int x = 0; x<17; x++){
Xpos = (Xpos<<1)+A[x];
}
if (Xpos==(1<<17)-1){
for (int x = 0; x<N; x++){
Remove(x);
}
return;
}
vector<int> rem;
for (int x = 0; x<Xpos; x++){
Remove(x);
}
for (int x = Xpos+1; x<N; x++){
if (A[x+17]){
while (!rem.empty()){
Remove(rem.back());
rem.pop_back();
}
Remove(x);
}
else{
rem.push_back(x);
}
}
Remove(Xpos);
for (auto x : rem){
Remove(x);
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |