# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92444 | Alexa2001 | Broken Device (JOI17_broken_device) | C++17 | 35 ms | 3312 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Annalib.h"
bool broken[200];
void setBlock(int i, int val)
{
Set(i+2, val&1); val >>= 1;
Set(i+1, val&1); val >>= 1;
Set(i, val&1);
}
void Anna( int N, long long X, int K, int P[] )
{
int i;
for(i=0; i<N; ++i) broken[i] = 0;
for(i=0; i<K; ++i) broken[P[i]] = 1;
for(i=0; i<N; i+=3)
{
int x, y, z;
x = broken[i], y = broken[i+1], z = broken[i+2];
if(x+y+z >= 2) /// skip
{
setBlock(i, 0);
continue;
}
if(x+y+z == 0)
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |