Submission #1167366

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11673662025-03-16 04:03:53trandangquangBroken Device (JOI17_broken_device)C++20
0 / 100
19 ms1344 KiB
#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;
int A[200];
void Set(int pos, int bit);
void hihi(int p, int val){
for(int i=0; i<3; ++i){
Set(p+i,val>>i&1);
}
}
void Anna(int N, long long X, int K, int P[]){
for(int i=0; i<N; ++i) A[i]=0;
for(int i=0; i<K; ++i) A[P[i]]=1;
deque<int> dq;
for(int i=0; i<60; ++i){
dq.push_back(X>>i&1);
}
for(int i=0; i<120; ++i) dq.push_back(0);
for(int i=0; i<N; i+=3){
int t=A[i]+A[i+1]+A[i+2];
if(t>=2){
Set(i,0), Set(i+1,0), Set(i+2,0);
}
else if(t==1){
if(A[i]==1){
if(dq[0]) hihi(i,6);
else hihi(i,2);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...