Submission #1215462

#TimeUsernameProblemLanguageResultExecution timeMemory
1215462jahongirBroken Device (JOI17_broken_device)C++20
41 / 100
19 ms1592 KiB
#include "Annalib.h"

#include <bits/stdc++.h>
using namespace std;

#define ll long long


void Anna( int N, long long X, int K, int P[] ){
  int cnt = 0;
  for(int i = 0, j = 0; i < N; i++){
    while(P[j] < i && j < K) j++;

    if((j < K && (P[j]==i || P[j]==i+1)) || i==N-1 || cnt == 60){
      Set(i,0); continue;
    }

    Set(i,1);
    if(X&(1ll<<cnt)) Set(i+1,1);
    else Set(i+1,0);

    cnt++, i++;
  }
}
#include "Brunolib.h"

#include <bits/stdc++.h>
using namespace std;

#define ll long long

long long Bruno( int N, int A[] ){

  int cnt = 0;
  ll res = 0;

  for(int i = 0; i < N; i++){
    if(A[i]){
      if(A[i+1]) res += (1ll<<cnt);
      cnt++; i++;
    }
  }

  return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...