# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
666493 | rainboy | Ancient Machine (JOI21_ancient_machine) | C++17 | 66 ms | 8280 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <vector>
using namespace std;
typedef vector<char> str;
namespace {}
void Anna(int n, str cc) {
str aa(n, 0);
int ix = 0;
while (ix < n && cc[ix] != 'X')
ix++;
int iz = n - 1;
while (iz >= 0 && cc[iz] != 'Z')
iz--;
if (ix < iz) {
aa[ix] = 1;
for (int i = ix + 1; i < iz; i++)
if (cc[i] == 'Z' && cc[i + 1] == 'Y')
aa[i] = 1;
aa[iz] = 1;
}
for (int i = 0; i < n; i++)
Send(aa[i]);
}
#include "Bruno.h"
#include <vector>
using namespace std;
typedef vector<int> vi;
namespace {}
void Bruno(int n, int l, vi aa) {
int ix = 0;
while (ix < n && aa[ix] == 0)
ix++;
if (ix == n) {
for (int i = 0; i < n; i++)
Remove(i);
return;
}
int iz = n - 1;
while (iz >= 0 && aa[iz] == 0)
iz--;
for (int h = ix, i = ix + 1; i <= iz; i++)
if (aa[i] == 1) {
for (int j = i - 1; j > h; j--)
Remove(j);
h = i + 1;
}
for (int i = ix + 1; i <= iz; i++)
if (aa[i] == 1) {
Remove(i);
if (i < iz)
Remove(i + 1);
}
for (int i = ix; i >= 0; i--)
Remove(i);
for (int i = iz + 1; i < n; i++)
Remove(i);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |