Submission #988406

# Submission time Handle Problem Language Result Execution time Memory
988406 2024-05-24T15:54:45 Z cnn008 Rarest Insects (IOI22_insects) C++17
Compilation error
0 ms 0 KB
#include "bits/stdc++.h"
using namespace std;
 
#ifdef N_N_C
#include "debug.h"
#else
#define cebug(...) "Arya"
#endif
 
#include "insects.h"
 
#define ll long long
 
const int mod=1e9+7;
 
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r){
    assert(l<=r);
    return uniform_int_distribution<int> (l,r)(rng);
}
set <int> s;
int f=1;
void move_inside(int i){
	int t=rand(1,200);
	s.insert(t);
	if(s.find(t)!=s.end()) f=2;
}
void move_outside(int i){
	s.erase(s.find(rand(1,200)));
	f=1;
}
int press_buton(){
	return f;
}
int min_cardinality(int N){
	int type=0;
	for(int i=0; i<N; i++){
		move_inside(i);
		press_buton();
		if(press_buton()==1){
			type++;
			move_outside(i);
		}
	}
	return rand(1,N/type);
}

Compilation message

/usr/bin/ld: /tmp/cc54R2zK.o: in function `move_inside(int)':
stub.cpp:(.text+0x0): multiple definition of `move_inside(int)'; /tmp/cct76YpL.o:insects.cpp:(.text+0x260): first defined here
/usr/bin/ld: /tmp/cc54R2zK.o: in function `move_outside(int)':
stub.cpp:(.text+0xe0): multiple definition of `move_outside(int)'; /tmp/cct76YpL.o:insects.cpp:(.text+0x1c0): first defined here
collect2: error: ld returned 1 exit status