Submission #959481

#TimeUsernameProblemLanguageResultExecution timeMemory
959481edogawa_somethingBroken Device (JOI17_broken_device)C++17
41 / 100
33 ms2628 KiB
#include<bits/stdc++.h>
#include "Annalib.h"
using namespace std;
typedef long long ll;
typedef vector<ll> vii;
typedef pair<ll,ll> pii;
#define F first
#define S second
#define pb push_back
#define all(v) v.begin(),v.end()
const ll M=160;
bool vis[M];
void Anna( int n, long long x, int k, int pos[] ){
  memset(vis,0,sizeof vis);
  for(int i=0;i<k;i++){
    vis[pos[i]]=1;
  }
  ll cnt=0;
  for(int i=0;i<n;i++){
    if(cnt>60){
      Set(i,0);
      continue;
    }
    if(i<n-1&&!vis[i]&&!vis[i+1]){
      Set(i,1);
      if((x&(1ll<<cnt))>0ll)
      Set(i+1,1);
      else
      Set(i+1,0);
      i++;
      cnt++;
      continue;
    }
    else{
      Set(i,0);
    }
  }
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vii;
typedef pair<ll,ll> pii;
#define F first
#define S second
#define pb push_back
#define all(v) v.begin(),v.end()
long long Bruno(int n,int a[]){
  ll ans=0,cnt=0;
  for(int i=0;i<n;i++){
    if(a[i]==1){
      if(a[i+1]==1){
        ans|=(1ll<<cnt);
        cnt++;
      }
      else{
        cnt++;
      }
      i++;
    }
  }
  return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...