commit 7a9e1ce1e779bd1bd40969f810f44171ed59ad3e
parent 04e6b3102360da5afa905b27bc25c0b4ff67596f
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sat, 28 Mar 2015 13:40:18 +0100
tweakitty
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contest/a3nm/main.cpp b/contest/a3nm/main.cpp
@@ -124,7 +124,7 @@ int main(int argc, char **argv) {
break;
int rscore = ((a + da) > 0 ? left[t+1][next.r][next.c] : 0) +
tab[t+1][a+da][next.r][next.c];
- if (rscore > best) {
+ if (rscore > best || (rscore == best && da > bestda)) {
best = rscore;
bestda = da;
}