# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1078408 | anton | Broken Device (JOI17_broken_device) | C++17 | 26 ms | 3000 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int N;
ll X;
void Anna( int _N, long long _X, int K, int P[] ){
N = _N;
X = _X;
vector<int> info_bits;
while(X>0){
info_bits.push_back(X%2LL);
X/=2LL;
}
vector<bool> broken(N, false);
for(int i = 0; i<K; i++){
broken[P[i]] = true;
}
vector<int> res(N);
auto mySet = [&](int pos, int val){
if(pos<N){
res[pos] = val;
}
};
int cur_id = 0;
for(int i = 0; i<info_bits.size(); i++){
while(broken[cur_id] || broken[cur_id+1]){
cur_id++;
}
mySet(cur_id, 1);
mySet(cur_id+1, info_bits[i]);
cur_id+=2;
}
for(int i = 0; i<N; i++){
Set(i, res[i]);
}
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
long long Bruno( int N, int A[] ){
vector<int> bits;
for(int i = 0; i<N; i++){
if(A[i]>0){
bits.push_back(A[i+1]);
i+=2;
}
}
ll res= 0;
for(ll i = 0; i<bits.size(); i++){
if(bits[i]>0){
res |= (1LL<<i);
}
}
return res;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |