Edit: Super secret editComplete redo. This thing is in it for evil reasonsthe win.
sub prob{
$_[0]+$_[1]-$_[0]*$_[1]
}
$_=<>;
INPUT:{
tr/ /,/;
@in = eval;
@rbidsfor(1..$#in){
=$bids[$rnum][$in[$_]]++
}
for(0..$#in){
"";$tbids[$rnum][$in[$_]]++
}
$rnum++;
$_=<>;
if($_ ne"\n"){redo INPUT}
}
for(10..100){$pre[$_]=0}
dirichlet: for(2..$#in/2+2){ #rough approximation,
$pre[$_]=prob($pre[$_], $rbids[$in[$_]]++1/int($#in/2+1))
}
LOWBIDCDP:{
@cdps1=(1,1,1,2,2,3,3,4);
@cdps2=(-2,-1,0,1,1,2,2,3,3);
for($pnt=1;$pnt<$#in+1;$pnt++$a=0;$a<8;$a++){
for($b=0;$b<9;$b++){
$sum=$cdps1[$a]+$cdps2[$b];
if($rbids[$pnt]==0$sum<1){$lows[$pnt]++;last$sum=1};
LOWBID $pre[$sum] = prob($pre[$sum], 1/72);
}
}
}
blazer: {
for($r=1;$r<$rnum;$r++){
winner: for($pnt=1;$pnt<101;$pnt++){
if($rbids[$pnt]==1$tbids[$r][$pnt] == 1){
if($pnt > 2){
$winnum[$pnt]++;
$wins++;
}
last LOWBIDwinner
}
}
}
$_=<>; if($wins==0){
$pre[3]=prob($pre[3], 1);last blazer
}
for(1..100){
$pre[$_]=prob($pre[$_], $winnum[$_]/$wins);
}
}
CC1: for($pnt=1;$pnt<101;$pnt++){
if($_$tbids[$rnum-1][$pnt] ne"\n"== 1){redo
INPUT $pre[$pnt] = prob($pre[$pnt], 1);last CC1
}
if($pnt==100){
for($pnt2=1;$pnt2<100;$pnt2++){
$pre[$pnt2] = prob($pre[$pnt2], $tbids[$rnum-1][$pnt2]/($#in+1));
}
}
}
$max=0;
$maxloc=3;CC2: for($pnt=1;$pnt<101;$pnt++){
if($rnum-2<0){$pre[7] = prob($pre[7], 1);last CC2}
if($tbids[$rnum-2][$pnt] == 1){
$pre[$pnt] = prob($pre[$pnt], 1);last CC2
}
if($pnt==100){
$pre[7] = prob($pre[7], 1);last CC2
}
}
one: {
$pre[1] = prob($pre[1], 1);
}
two: {
$pre[2] = prob($pre[2], 1);
}
five: {
$pre[5] = prob($pre[5], 1);
}
eight: {
$pre[8] = prob($pre[8], 1);
}
mueller: {
$a=($#in+2)/4;
$pre[int$a]=prob($pre[int$a], 1)
}
schwarzenbeck: {
$a=($#in+2)/4+1;
$pre[int$a]=prob($pre[int$a], 1)
}
beckenbauer: {
$a=($#in+2)/4+2;
$pre[int$a]=prob($pre[int$a], 1)
}
totalbots: {
$pre[$#in+1]=prob($pre[$#in+1], 1)
}
joe: {
$sum=0;
for(1..100){
$sum+=$tbids[$rnum-1][$_];
}
$average=$sum/($#in+1);
if($average==0){$average=10};
$pre[$average]=prob($pre[$average], 1);
}
node: {
$max=0;$maxloc=0;
for(1..100){
if($lows[$_]>$max$tbids[$rnum-1][$_]>$max){$maxloc=$_;$max=$lows[$_]$max=$tbids[$rnum-1][$_];$maxloc=$_}
}
print$maxloc$maxloc--;
#if($maxloc==0){
$maxloc=20;
#}
if($rnum==1){$maxloc=3}
$pre[$maxloc]=prob($pre[$maxloc], 1);
}
#print"\n@pre\n\n";
decide: for(1..100){if($pre[$_]<0.5){print; last decide}}