# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
416945 | oolimry | Ancient Machine (JOI21_ancient_machine) | C++17 | 88 ms | 9060 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int) x.size())
#define show(x) cerr << #x << " is " << x << endl;
#define show2(x, y) cerr << #x << " is " << x << ", " << #y << " is " << y << endl;
typedef long long lint;
typedef pair<lint, lint> ii;
void Anna(int n, vector<char> s){
int X = -1;
for(int i = 0;i < n;i++){
if(s[i] == 'X'){
X = i;
break;
}
}
if(X == -1) return;
vector<int> tosend;
for(int i = X+1;i < n;i++){
if(s[i] == 'Z') tosend.push_back(1);
else tosend.push_back(0);
}
for(int x : tosend) Send(x);
for(int i = 0;i < 18;i++){
Send(X&1);
X >>= 1;
}
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int) x.size())
#define show(x) cerr << #x << " is " << x << endl;
#define show2(x, y) cerr << #x << " is " << x << ", " << #y << " is " << y << endl;
typedef long long lint;
typedef pair<lint, lint> ii;
void Bruno(int n, int L, vector<int> A){
int vis[n]; fill(vis,vis+n,0);
if(sz(A) == 0){
for(int i = 0;i < n;i++) Remove(i);
return;
}
int X = 0;
for(int i = 0;i < 18;i++){
X *= 2;
X += A.back();
A.pop_back();
}
int prev = X+1;
for(int i = X+1;i < n;i++){
int a = A[i-X-1];
if(a == 1){
for(int j = i-1;j >= prev;j--) Remove(j), vis[j] = 1;
Remove(i); vis[i] = 1;
prev = i+1;
}
}
for(int i = 0;i < n;i++){
if(not vis[i]) Remove(i);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |