제출 #959124

#제출 시각아이디문제언어결과실행 시간메모리
959124AbitoBroken Device (JOI17_broken_device)C++17
41 / 100
37 ms2584 KiB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
bool vis[155];
void Anna( int n, long long X, int k, int p[] ){
    //for (int i=0;i<k;i++) cout<<p[i]<<' ';cout<<endl;
    memset(vis,0,sizeof(vis));
    long long j=0;
    for (int i=0;i<k;i++) vis[p[i]]=1;
    for (int i=0;i<n;i+=2){
        if (vis[i] || vis[i+1] || j>=60LL){
            Set(i,0);
            Set(i+1,0);
            continue;
        }
        if (X&(1LL<<j)){
            Set(i,0);
            Set(i+1,1);
        }
        else{
            Set(i,1);
            Set(i+1,0);
        }
        j++;
    }return;
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno( int n, int a[] ){
    //for (int i=0;i<n;i++) cout<<a[i]<<' ';cout<<endl;
    long long X=0,j=0;
    for (int i=0;i<n;i+=2){
        if (!a[i] && !a[i+1]) continue;
        if (a[i+1]) X|=(1LL<<j);
        j++;
    }//cout<<X<<endl;
    return X;
}
#Verdict Execution timeMemoryGrader output
Fetching results...