ens-ulm-1-2015

google hashcode 2015 source for team ens-ulm-1
git clone https://a3nm.net/git/ens-ulm-1-2015/
Log | Files | Refs

commit cc2d82bc9308ccb45337df963bc5470ec6ddaaea
parent 10942877fb2421a1a146d4ec3177bf55beea3fe2
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 28 Mar 2015 13:20:14 +0100

cleanup

Diffstat:
contest/a3nm/main.cpp | 41-----------------------------------------
1 file changed, 0 insertions(+), 41 deletions(-)

diff --git a/contest/a3nm/main.cpp b/contest/a3nm/main.cpp @@ -56,48 +56,7 @@ void calccoverage() { coverage[r][c].push_back(l); } -int chooseda(int b, int t, int a, int r, int c) { - int best = 0, bestda; - if (a == 0) - bestda = 1; - if (a == 1) - bestda = rand() % 2; - if (a == A) - bestda = (rand() % 2) - 1; - if (a > 1 && a < A) { - bestda = (rand() % 3) - 1; - } - for (int da = -1; da <= 1; da++) { - if (a <= 1 && da == -1) - continue; // don't go back down or go down on ground - if (a + da > A) - continue; // can't go too high - - // compute improvement - Pt next = dest[a + da][r][c]; - int cscore = 0; - // loons on ground and loons out don't help - if (a + da > 0 && next.r >= 0) { - for (unsigned int i = 0; i < coverage[next.r][next.c].size(); i++) { - int l = coverage[next.r][next.c][i]; - cscore += covered[t+1][l] ? 0 : 1; - } - } - if (next.r < 0) { - // out is BAD - cscore = -1; - } - if (cscore > best) { - best = cscore; - bestda = da; - } - } - printf("best da is %d with score %d\n", bestda, best); - return bestda; -} - int main(int argc, char **argv) { - srand(42); scanf("%d%d%d", &R, &C, &A); scanf("%d%d%d%d", &L, &V, &B, &T); scanf("%d%d", &rs, &cs);