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