# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1262089 | patgra | Broken Device (JOI17_broken_device) | C++20 | 20 ms | 1344 KiB |
#include "Annalib.h"
#include <bits/stdc++.h>
#define rep(a,b,c) for(auto a = (b); a != (c); a++)
#define repD(a,b,c) for(auto a = (b); a != (c); a--)
#define repIn(a, b) for(auto& a : (b))
#define repIn2(a, b, c) for(auto& [a, b] : (c))
constexpr bool dbg = 1;
#define DEBUG if constexpr(dbg)
#define DC DEBUG std::cerr
#define eol std::endl
#define ll long long
#define pb push_back
using namespace std;
namespace {
constexpr int blockS = 6;
};
void Anna(int N, ll X, int K, int P[]) {
set<int> used, bad;
rep(i, 0, K) bad.insert(P[i]);
int i = 0;
while(i < N - blockS) {
bool g = 1;
rep(j, 0, blockS) if(bad.count(j)) g = 0;
if(!g) { Set(i++, 0); continue; }
Set(i, 1);
rep(j, 1, blockS) Set(i + j, X & 1), X >>= 1;
i += blockS;
}
while(i < N) {
Set(i, 1);
i++;
}
}
#include <bits/stdc++.h>
#define rep(a,b,c) for(auto a = (b); a != (c); a++)
#define repD(a,b,c) for(auto a = (b); a != (c); a--)
#define repIn(a, b) for(auto& a : (b))
#define repIn2(a, b, c) for(auto& [a, b] : (c))
constexpr bool dbg = 1;
#define DEBUG if constexpr(dbg)
#define DC DEBUG std::cerr
#define eol std::endl
#define ll long long
#define pb push_back
using namespace std;
namespace {
constexpr int blockS = 6;
};
ll Bruno(int N, int A[]) {
vector<int> xd;
int i = 0;
while(i < N - blockS) {
if(A[i++] == 0) continue;
rep(j, 0, blockS - 1) xd.pb(A[i + j]);
i += blockS - 1;
}
ll ret = 0;
ranges::reverse(xd);
repIn(j, xd) ret = (ret << 1) | j;
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |