# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
127374 | Utaha | Broken Device (JOI17_broken_device) | C++14 | 41 ms | 3064 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Annalib.h"
void Anna( int N, long long X, int K, int P[] ){
bool ret[150]={0};
bool notused[150]={0};
for(int i=0;i<K;i++){
notused[P[i]]=1;
notused[P[i]^1]=1;
}
int pt=37;
for(int i=0;i<N;i+=2) if(!notused[i]){
long long type=X%3;
X/=3;
if(type==0){
ret[i]=1;
ret[i+1]=0;
}
else if(type==1){
ret[i]=0;
ret[i+1]=1;
}
else{
ret[i]=ret[i+1]=1;
}
pt--;
if(pt==0) break;
}
for(int i=0;i<N;i++) Set(i,ret[i]);
}
#include "Brunolib.h"
long long Bruno( int N, int A[] ){
long long ret=0;
long long base=1;
for(int i=0;i<N;i+=2){
if(A[i]==0&&A[i+1]==0) continue;
int type=-1;
if(A[i]==1){
if(A[i+1]==1) type=2;
else type=0;
}
else type=1;
ret+=base*type;
base*=3;
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |