# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
106671 | thebes | Broken Device (JOI17_broken_device) | C++14 | 69 ms | 3104 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
int lol[200], i, j;
void Anna(int N, long long X, int K, int *P){
memset(lol, 0, sizeof(lol));
for(i=0;i<K;i++) lol[P[i]]=1;
j = 59;
for(i=0;i<N;i+=2){
if(j<0){
Set(i, 0);
Set(i+1, 0);
continue;
}
if((1LL<<j)&X){
if(j>=1&&((1LL<<(j-1))&X)&&!lol[i+1]&&!lol[i]){
Set(i, 1);
Set(i+1, 1);
j-=2;
}
else if(!lol[i]){
Set(i, 1);
Set(i+1, 0);
j--;
}
else{
Set(i, 0);
Set(i+1, 0);
}
}
else{
if(!lol[i+1]){
Set(i, 0);
Set(i+1, 1);
j--;
}
else{
Set(i, 0);
Set(i+1, 0);
}
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno(int N, int *A){
long long ans = 0;
int j = 59;
for(int i=0;i<N;i+=2){
if(A[i]==A[i+1]&&A[i]==1){
ans += (1LL<<j);
ans += (1LL<<(j-1));
j -= 2;
}
else if(A[i]!=A[i+1]&&j>=0){
if(A[i]==1) ans += (1LL<<j);
j--;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |