Submission #549265

# Submission time Handle Problem Language Result Execution time Memory
549265 2022-04-15T13:14:29 Z brunnorezendes Broken Device (JOI17_broken_device) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "Annalib.h"

using namespace std;

typedef long long int ll;
typedef vector <int> vi;

void Anna(int n, ll x, int k, vi p){
	int cont=0, i, bits=0;
	for(i=0;i<n;i++){
		if(cont<k && p[cont]==i){
			cont++;
			Set(i, 0);
			continue;
		}
		if((1<<bits)>x) continue;
		if(x&(1<<bits)){
			if(cont<k && p[cont]==i+1){
				Set(i, 0);
				continue;
			}
			else{
				Set(i, 1);
				if(i<n-1) Set(i+1, 1);
				i++;
			}
		}
		else{
			Set(i, 1);
			if(i<n-1) Set(i+1, 0);
			if(cont<k && p[cont]==i+1) cont++;
			i++;
		}
		bits++;
	}
}
#include <bits/stdc++.h>
#include "Brunolib.h"

using namespace std;

typedef vector <int> vi;
typedef long long int ll;

ll Bruno(int n, vi a){
	ll x=0;
	int bits=0;
	for(int i=0;i<n;i++){
		if(a[i]){
			if(i==n-1 || a[i+1]) x+=(ll)(1<<bits);
			i++;
			bits++;
		}
	}
	return (x);
}

Compilation message

/usr/bin/ld: /tmp/ccohUFrI.o: in function `main':
grader_anna.c:(.text.startup+0x10b): undefined reference to `Anna(int, long long, int, int*)'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/ccjmPZhp.o: in function `main':
grader_bruno.cpp:(.text.startup+0x13d): undefined reference to `Bruno(int, int*)'
collect2: error: ld returned 1 exit status