# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
902652 | nguyentunglam | Broken Device (JOI17_broken_device) | C++17 | 40 ms | 2656 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;
void Anna( int n, long long x, int k, int p[] ){
vector<bool> broken(n);
for(int i = 0; i < n; i++) broken[i] = 0;
for(int i = 0; i < k; i++) broken[p[i]] = 1;
for(int i = 0, pre = -1, j = 59; i < n; i++) {
if (broken[i] || j < 0) {
Set(i, 0);
continue;
}
bool a = x >> j & 1;
bool b = i - pre & 1;
if (a == b) {
pre = i;
j--;
Set(i, 1);
}
else Set(i, 0);
}
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;
long long Bruno( int n, int a[] ){
long long x = 0;
for(int i = 0, pre = -1, j = 59; i < n && j >= 0; i++) if (a[i]) {
bool bit = i - pre & 1;
if (bit) x |= (1LL << j);
j--;
pre = i;
}
// for(int i = 0; i < n; i++) cout << a[i] << " "; cout << endl;
// cout << "answer :" << x << endl;
return x;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |