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