# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
131687 | zoooma13 | Broken Device (JOI17_broken_device) | C++14 | 50 ms | 3608 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#include "Annalib.h"
using namespace std;
void Anna( int N, long long X, int K, int P[] ){
/*srand(8465554);
vector <int> ord(N);
iota(ord.begin() ,ord.end() ,0);
random_shuffle(ord.begin() ,ord.end());*/
vector <bool> bad(N, false);
for(int i=0; i<K; i++)
bad[P[i]] = true;
int len = log2(X)+1 ,j = 0;
vector <bool> enc(N ,0);
for(int i=0; i<N-1; i++){
if(bad[i])
continue;
bool bit = bool(X&(1LL<<j));
if(!bit)
{ enc[i] = 1 ,enc[i+1] = 0; j++ ,i++; }
else if(bit && !bad[i+1])
{ enc[i] = 1 ,enc[i+1] = 1; j++ ,i++; }
if(j >= len)
break;
}
for(int i=0; i<N; i++)
Set(i ,enc[i]);
//assert(false);
}
#include "bits/stdc++.h"
#include "Brunolib.h"
using namespace std;
long long Bruno( int N, int A[] ){
/*srand(8465554);
vector <int> ord(N);
iota(ord.begin() ,ord.end() ,0);
random_shuffle(ord.begin() ,ord.end());*/
int j = 0;
long long X = 0LL;
for(int i=0; i<N-1; i++){
if(A[i])
{ X |= (1LL<<j)*A[i+1]; j++ ,i++; }
}
return X;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |