# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1174373 | ortsac | Broken Device (JOI17_broken_device) | C++20 | 31 ms | 1588 KiB |
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
void Anna(int32_t N, int x, int32_t k, int32_t p[] ){
vector<int> ans(N);
vector<int> broken(N);
for (int i = 0; i < k; i++) broken[p[i]] = 1;
int curr = 0;
for (int i = 0; i < 60; i++) {
int v = (((1LL << i) & x) > 0);
while (broken[curr] || broken[curr + 1]) curr += 2;
ans[curr] = 1;
ans[curr + 1] = v;
curr += 2;
}
for (int i = 0; i < N; i++) {
//cout << ans[i] << " ";
Set(i, ans[i]);
}
//cout << "\n";
//cout << x << "\n";
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
int Bruno(int32_t N, int32_t A[] ) {
int curr = 0;
int ans = 0;
for (int i = 0; i < N; i += 2) {
if (A[i] != 0) {
ans += ((1LL << curr)*A[i + 1]);
curr++;
}
}
//cout << ans << "\n";
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |