# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
664249 | blue | Ancient Machine (JOI21_ancient_machine) | C++17 | 74 ms | 8728 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <bits/stdc++.h>
namespace
{
using namespace std;
using vi = vector<int>;
}
void Anna(int N, vector<char> S)
{
// cerr << "hello\n";
int fx = 0;
int lz = N-1;
while(fx < N && S[fx] != 'X')
fx++;
while(lz >= 0 && S[lz] != 'Z')
lz--;
if(fx == N || lz == -1)
{
// cerr << "hello2\n";
return;
}
vi tosend(N+1, 0);
tosend[fx] = 1;
tosend[lz+1] = 1;
for(int i = fx+2; i <= lz-1; i++)
{
if(S[i-1] == 'Z' && S[i] == 'Y')
tosend[i] = 1;
}
// for(int i = 0; i <= N; i++)
// cerr << tosend[i];
// cerr << '\n';
for(int f : tosend)
Send(f);
}
#include "Bruno.h"
#include <bits/stdc++.h>
namespace
{
using namespace std;
using vi = vector<int>;
using pii = pair<int, int>;
using vpii = vector<pii>;
}
void Bruno(int N, int L, vi A)
{
if(A.empty())
{
for(int i = 0; i < N; i++)
Remove(i);
return;
}
int lz = N;
while(A[lz] != 1)
lz--;
lz--;
int fx = 0;
while(A[fx] != 1)
fx++;
// cerr << fx << ' ' << lz << '\n';
for(int i = 0; i < fx; i++)
Remove(i);
for(int i = lz+1; i < N; i++)
Remove(i);
vi st;
for(int i = fx+1; i <= lz; i++)
{
if(i < lz && A[i+1] == 0)
{
// cerr << "add " << i << " to stack\n";
st.push_back(i);
}
else
{
while(!st.empty())
{
Remove(st.back());
// cerr << "pop " << st.back() << '\n';
st.pop_back();
}
Remove(i);
// cerr << "remove Z : " << i << '\n';
}
}
Remove(fx);
// cerr << "final remove " << fx << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |