Submission #100044

#TimeUsernameProblemLanguageResultExecution timeMemory
100044tqbfjotldBroken Device (JOI17_broken_device)C++14
8 / 100
64 ms3312 KiB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

void Anna( int N, long long X, int K, int P[] ){
  if (K==1&&P[0]<65){
    for (int x = 0; x<65; x++){
        Set(x,0);
    }
    for (long long x = 0; x<64; x++){
        Set(65+x,(X&((long long)1<<x))==0?0:1);
    }
    for (int x = 129; x<N-2; x++){
        Set(x,0);
    }
    Set(N-2,1);
    Set(N-1,1);
  }
  else{
    for (int x = 0; x<64; x++){
        Set(x,(X&(1LL<<x))==0?0:1);
    }
    for (int x = 64; x<N; x++){
        Set(x,0);
    }
  }
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;

long long Bruno( int N, int A[] ){
  if (A[N-1]==1||A[N-2]==1){
    long long ans = 0;
    for (long long x = 65; x<129; x++){
        ans+=(((long long)A[x])<<(x-65));

    }

    return ans;
  }
  else{
    long long ans = 0;
    for (long long x = 0; x<64; x++){
        ans+=(((long long)A[x])<<(x));
    }
    return ans;
  }
}
#Verdict Execution timeMemoryGrader output
Fetching results...