# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
798399 | NothingXD | Ancient Machine (JOI21_ancient_machine) | C++17 | 1287 ms | 12780 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
High hopes and noble endeavors...
Will shine with all the twinkling stars.
We hold you next to us...
The galaxy, so glorious.
We'll build with all of our dreams...
A new world that bravely gleams.
Char is fighting for our prayers!
Char is fighting for our prayers!
*/
#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef complex<double> point;
namespace {
void debug_out(){cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T){
cerr << H << ' ';
debug_out(T...);
}
#define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define MP(x, y) make_pair(x, y)
const int maxn = 1e5 + 10;
int n;
string s;
}
void Anna(int N, std::vector<char> S) {
n = N;
for (int i = 0; i < n; i++){
s.push_back(S[i]);
}
for (int i = 0; i < n; i++){
debug(s[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);
}
}
}
/*
High hopes and noble endeavors...
Will shine with all the twinkling stars.
We hold you next to us...
The galaxy, so glorious.
We'll build with all of our dreams...
A new world that bravely gleams.
Char is fighting for our prayers!
Char is fighting for our prayers!
*/
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef complex<double> point;
namespace {
void debug_out(){cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T){
cerr << H << ' ';
debug_out(T...);
}
#define debug(...) cerr << "(" << #__VA_ARGS__ << "): ", debug_out(__VA_ARGS__)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define MP(x, y) make_pair(x, y)
const int maxn = 1e5 + 10;
int n;
string s;
}
void Bruno(int N, int L, std::vector<int> A) {
n = N;
for (int i = 1; i < L; i += 2){
if (A[i-1] == 0 && A[i] == 0) s.push_back('X');
if (A[i-1] == 0 && A[i] == 1) s.push_back('Y');
if (A[i-1] == 1 && A[i] == 0) s.push_back('Z');
debug(s.back());
}
debug(s.size());
vector<int> v;
for (int i = 0; i < n; i++){
if (v.empty() && s[i] == 'X'){
v.push_back(i);
}
else if (v.empty()){
Remove(i);
}
else{
if (s[i] != 'Z'){
v.push_back(i);
}
else{
while(v.size() > 1){
Remove(v.back());
v.pop_back();
}
Remove(i);
}
}
}
while(!v.empty()){
Remove(v.back());
v.pop_back();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |