Submission #231940

# Submission time Handle Problem Language Result Execution time Memory
231940 2020-05-15T11:34:32 Z dvdg6566 Broken Device (JOI17_broken_device) C++14
Compilation error
0 ms 0 KB
#include "Annalib.h"
#include<iostream>
using namespace std;
int R[150];
int B[150];
typedef long long ll;

void Anna( int N, long long X, int K, int P[] ){
	assert(N==150);
	for(int i=0;i<K;++i){
		B[P[i]]=1;
	}
	ll a=0;
	for(int i=0;i<N/2;++i){
		if(B[i]||B[i+N/2])continue;
		R[i]=1;
		R[i+N/2]=(X&(1LL<<a))>0;
		++a;
		if(a>62)break;
	}
  for( int i = 0; i < N; i++ ){
  	// cout<<R[i];
    Set( i, R[i] );
  }
}
#include "Brunolib.h"
using namespace std;
typedef long long ll;

long long Bruno( int N, int A[] ){
  ll ans=0;
  ll a=0;
  for(int i=0;i<N/2;++i){
  	if(A[i]!=1)continue;
  	ans+=A[i+N/2]*(1LL<<a);
  	++a;
  	if(a>62)break;
  }
  return ans;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:9:2: error: 'assert' was not declared in this scope
  assert(N==150);
  ^~~~~~
Anna.cpp:9:2: note: suggested alternative: 'qsort'
  assert(N==150);
  ^~~~~~
  qsort