# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
882395 | willychan | Ancient Machine (JOI21_ancient_machine) | C++17 | 60 ms | 10484 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <vector>
namespace {
int variable_example = 0;
}
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 <vector>
#include<bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
int FunctionExample(int P) { return 1 - P; }
} // namespace
void Bruno(int N, int L, std::vector<int> A) {
vector<int> arr(N);
for(int i=0;i<N;i++){
int c = 2*A[2*i] + A[2*i+1];
arr[i]=c;
}
queue<int> z;
vector<bool> taken(N,0);
vector<tuple<int,int,int> > dostuff;
for(int i=0;i<N;i++){
if(arr[i]==2) z.push(i);
}
stack<int> x;
for(int i=0;i<N;i++){
if(arr[i]==0){
x.push(i);
continue;
}
if(arr[i]==1){
while(x.size() && x.top()>i) x.pop();
while(z.size() && z.front()<i) z.pop();
if(x.size() && z.size()){
taken[x.top()]=1;
taken[z.front()]=1;
taken[i]=1;
dostuff.push_back({x.top(),i,z.front()});
x.pop();
z.pop();
}
}
}
for(int i=0;i<N;i++) if(!taken[i]) Remove(i);
for(auto i : dostuff){
Remove(get<1>(i));
Remove(get<0>(i));
Remove(get<2>(i));
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |