# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1001125 | Tob | Broken Device (JOI17_broken_device) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "Annalib.h"
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
void Anna(int n, ll x, int k, int p[]) {
int bio[150] = {0}, a[150] = {0};
for (int i = 0; i < k; i++) bio[p[i]] = 1;
for (ll i = 0, j = 0; i < n; i += 3) {
int sum = bio[i]+bio[i+1]+bio[i+2];
if (sum > 1) continue;
int o = ((x >> j) & 1), o2 = ((x >> (j+1)) & 1);
if (o) {
if (sum == 0) a[i+1] = a[i+2] = 1, a[i] = o2, j += 2;
else a[i] = bio[i+2], a[i+1] = bio[i+2], a[i+2] = bio[i+2]^1, j++;
}
else {
if (bio[i+1] || sum == 0) a[i] = 1, a[i+2] = o2, j += 2;
else a[i+1] = 1, j++;
}
}
for (int i = 0; i < n; i++) Set(i, a[i]);
}
#include <bits/stdc++.h>
#include "Brunolib.h"
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
typedef long long ll;
typedef pair <ll, ll> pii;
ll Bruno(int n, int a[]) {
ll x = 0;
for (int i = n-3; i >= 0; i -= 3) {
int o = 4*a[i]+2*a[i+1]+a[i+2];
if (o == 0) continue;
if (zn[o] == 1) x = 2*x+va[o];
else x = 4*x+va[o];
}
return x;
}