# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
61224 | gs14004 | Broken Device (JOI17_broken_device) | C++17 | 86 ms | 3944 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"
#include <bits/stdc++.h>
using namespace std;
int seq[222];
int chk[222];
void Embed(int pos, int val){
Set(pos, val >> 2);
Set(pos + 1, (val >> 1) & 1);
Set(pos + 2, val & 1);
}
void Anna( int N, long long X, int K, int P[] ){
for(int i=0; i<60; i++){
seq[i] = (X >> i) & 1;
}
for(int i=0; i<150; i++) chk[i] = 1;
for(int i=0; i<K; i++){
chk[P[i]] = 0;
}
int ptr = 0;
for(int i=0; i<150; i+=3){
if(chk[i] + chk[i+1] + chk[i+2] <= 1){
Embed(i, 0);
}
else if(chk[i] + chk[i+1] + chk[i+2] == 3){
if(seq[ptr] == 0 && seq[ptr+1] == 0){
Embed(i, 4);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |