# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
709596 | yuuhi | Ancient Machine (JOI21_ancient_machine) | C++17 | 73 ms | 8340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "Anna.h"
#define f first
#define s second
#define double long double
#define _size(x) ((int)((x).size()))
using namespace std ;
typedef pair< int , int > ii ;
void Anna (int n , vector< char > s) {
int flag = 0 ;
for (int i = 0 ; i < n ; ++ i) {
if (!flag && s[i] == 'X') {
flag = 1 ;
Send(1) ;
continue ;
}
if (!flag) {
Send(0) ;
continue ;
}
if (s[i] == 'Z') {
Send(1) ;
}
else {
Send(0) ;
}
}
}
#include<bits/stdc++.h>
#include "Bruno.h"
#define f first
#define s second
#define double long double
#define _size(x) ((int)((x).size()))
using namespace std ;
typedef pair< int , int > ii ;
void Bruno (int n , int L , vector< int > b) {
vector< int > erased(n) ;
auto Erase = [&](int x) {
if (erased[x]) return ;
erased[x] = 1 ;
Remove(x) ;
};
for (int i = 0 , last = -1 ; i < n ; ++ i) if (b[i]) {
if (last != -1) {
for (int j = i - 1 ; j >= last + 1 ; -- j) Erase(j) ;
Erase(i) ;
}
last = i ;
}
for (int i = 0 ; i < n ; ++ i) Erase(i) ;
}
/*
10
X Y Y X Z Y X Z Y Z
*/
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |