@@ -16,7 +16,6 @@ pub struct State<'a> {
16
16
remaining : usize ,
17
17
hand_count : usize ,
18
18
tele_count : usize ,
19
- tele_points : Vec < Point > ,
20
19
commands : Vec < Command > ,
21
20
}
22
21
@@ -71,7 +70,6 @@ impl<'a> State<'a> {
71
70
72
71
let hand_count = 0 ;
73
72
let tele_count = 0 ;
74
- let tele_points = Vec :: new ( ) ;
75
73
let commands = Vec :: new ( ) ;
76
74
77
75
State {
@@ -85,7 +83,6 @@ impl<'a> State<'a> {
85
83
remaining,
86
84
hand_count,
87
85
tele_count,
88
- tele_points,
89
86
commands,
90
87
}
91
88
}
@@ -193,32 +190,11 @@ impl<'a> State<'a> {
193
190
self . commands . push ( Command :: NewHand ( new_hand) ) ;
194
191
}
195
192
196
- if self . tele_count > 0 {
197
- self . tele_points . push ( self . current_point ) ;
198
- self . tele_count -= 1 ;
199
- self . commands . push ( Command :: ResetBeacon ) ;
200
- }
201
-
202
193
self . pass_current_point ( ) ;
203
194
204
195
let base_moves = self . find_shortest_path ( self . current_point ) ;
205
196
206
- let tele_moves = self
207
- . tele_points
208
- . iter ( )
209
- . map ( |start| ( start, self . find_shortest_path ( * start) ) )
210
- . min_by_key ( |( _, v) | v. len ( ) ) ;
211
-
212
- let moves = match tele_moves {
213
- Some ( ( tele_point, ref tele_moves) ) if tele_moves. len ( ) + 1 < base_moves. len ( ) => {
214
- self . commands . push ( Command :: ShiftBeacon ( * tele_point) ) ;
215
- self . current_point = * tele_point;
216
- tele_moves
217
- }
218
- _ => & base_moves,
219
- } ;
220
-
221
- for m in moves {
197
+ for m in base_moves {
222
198
self . current_point = self . current_point . move_with ( & m) ;
223
199
self . pass_current_point ( ) ;
224
200
self . commands . push ( Command :: Move ( m. clone ( ) ) ) ;
0 commit comments