Skip to content

Commit abb06bc

Browse files
committed
Use distance
1 parent b848f71 commit abb06bc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/solve.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,11 @@ impl<'a> State<'a> {
255255
let (_, cost) = data[&c];
256256

257257
if self.is_goal(robot_idx, c) {
258-
let value = (self.count_pass(robot_idx, c), rng.gen::<usize>());
258+
let value = (
259+
u32::max_value() - cost,
260+
self.count_pass(robot_idx, c),
261+
rng.gen::<usize>(),
262+
);
259263
match goal_value {
260264
Some(goal_value) if goal_value > value => {}
261265
_ => {

test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ echo "Creating $OUTPUT"
1717
mkdir -p $OUTPUT
1818

1919
SECONDS=0
20-
./target/release/icfpc2019 --output $OUTPUT --input ./input
20+
./target/release/icfpc2019 --output $OUTPUT --input ./input --duration 300
2121
echo "$(date +"%Y-%m-%d %T"): running time is $SECONDS secs" | tee -a $LOG_FILE
2222

2323
cargo run --bin score --release -- --input ./input --output $OUTPUT | tee -a $LOG_FILE

0 commit comments

Comments
 (0)