# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
100873 | Pro_ktmr | Broken Device (JOI17_broken_device) | C++14 | 68 ms | 3072 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#include"Annalib.h"
//void Set(int pos, int bit)
//N=150
void Anna(int N, long long X, int K, int P[]){
bool canUse[150];
for(int i=0; i<N; i++) canUse[i] = true;
for(int i=0; i<K; i++) canUse[P[i]] = false;
LL now = 0;
for(int i=0; i<N; i++){
if(i+1 < N && canUse[i] && canUse[i+1]){
Set(i, 1);
Set(i+1, (X>>now)%2);
i++;
now++;
}
else if(i+1 < N && canUse[i] && (X>>now)%2 == 0){
Set(i, 1);
Set(i+1, 0);
i++;
now++;
}
else{
Set(i, 0);
}
}
}
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#include"Brunolib.h"
long long Bruno(int N, int A[]){
LL ans = 0;
LL now = 0;
for(int i=0; i+1<N; i++){
if(A[i] == 1){
ans += (A[i+1]<<now);
i++;
now++;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |