# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1144580 | ibsha | Broken Device (JOI17_broken_device) | C++20 | 20 ms | 1344 KiB |
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void Anna( int N, long long X, int K, int P[] ){
set<ll> se;
for (int i = 0; i < K; i++) se.insert(P[i]);
ll bit = 0;
for (int i = 0; i < N/2; i++){
if (se.count(i*2) or (se.count(i*2+1))){
Set(i*2,0);
Set(i*2+1,0);
continue;
}
if (X & (1 << bit)){
Set(i*2,1);
Set(i*2+1,0);
}
else{
Set(i*2,0);
Set(i*2+1,1);
}
bit++;
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
long long Bruno( int N, int A[] ){
ll bit=0;
ll ret=0;
for (int i=0;i<N/2; i++){
if (A[i*2] == A[i*2+1] and A[i*2] == 0) continue;
if (A[i*2] == 0 and A[i*2+1] == 1);
else if (A[i*2] == 1 and A[i*2+1] == 0) ret |= (1<<bit);
bit++;
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |