| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 102635 | fanache99 | Broken Device (JOI17_broken_device) | C++14 | 67 ms | 3312 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Annalib.h"
const int MAXN = 150;
const int BITS = 60;
int a[MAXN];
bool bad[MAXN];
void Anna(int n, long long x, int k, int p[]){
for (int i = 0; i < n; i++) {
bad[i] = false;
a[i] = 0;
}
for (int i = 0; i < k; i++)
bad[p[i]] = true;
for (int i = BITS - 1, j = -1; i >= 0; i--) {
if (x & (1LL << i))
j += 2;
else
j++;
while (j < n && bad[j])
j += 2;
if (j < n)
a[j] = 1;
}
for (int i = 0; i < n; i++)
Set(i, a[i]);
}
#include "Brunolib.h"
long long Bruno(int n, int a[]) {
long long answer = 0;
int bit = 0;
for (int i = 0; i < n; i++) {
if (!a[i])
bit ^= 1;
else {
answer = answer * 2 + bit;
bit = 0;
}
}
return answer;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
