# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
127991 | Utaha | Broken Device (JOI17_broken_device) | C++14 | 46 ms | 3576 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>
void Anna( int N, long long X, int K, int P[] ){
X^=0x84d9302917c854LL;
// std::cout<<X<<'\n';
// for(long long i=X;i;i/=3) std::cout<<i%3;
// std::cout<<'\n';
bool ret[150]={0};
bool notused[150]={0};
for(int i=0;i<K;i++){
notused[P[i]]=1;
}
int pt=38;
for(int i=0;i<N;i+=2){
long long type=X%3;
if(type==0){
if(notused[i]) continue;
ret[i]=1;
ret[i+1]=0;
}
else if(type==1){
if(notused[i+1]) continue;
ret[i]=0;
ret[i+1]=1;
}
else{
if(notused[i]||notused[i+1]) continue;
ret[i]=ret[i+1]=1;
}
// std::cout<<X%3<<'\n';
X/=3;
pt--;
if(pt==0) break;
}
// for(int i=0;i<N;i++) std::cout<<ret[i];
// std::cout<<'\n';
for(int i=0;i<N;i++) Set(i,ret[i]);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
long long Bruno( int N, int A[] ){
long long ret=0;
long long base=1;
for(int i=0;i<N;i+=2){
if(A[i]==0&&A[i+1]==0) continue;
int type=-1;
if(A[i]==1){
if(A[i+1]==1) type=2;
else type=0;
}
else type=1;
// std::cout<<"Bruno: "<<type<<'\n';
ret+=base*type;
base*=3;
}
// std::cout<<ret<<'\n';
return ret^0x84d9302917c854LL;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |