@@ -16,7 +16,6 @@ pub struct State<'a> {
1616 remaining : usize ,
1717 hand_count : usize ,
1818 tele_count : usize ,
19- tele_points : Vec < Point > ,
2019 commands : Vec < Command > ,
2120}
2221
@@ -71,7 +70,6 @@ impl<'a> State<'a> {
7170
7271 let hand_count = 0 ;
7372 let tele_count = 0 ;
74- let tele_points = Vec :: new ( ) ;
7573 let commands = Vec :: new ( ) ;
7674
7775 State {
@@ -85,7 +83,6 @@ impl<'a> State<'a> {
8583 remaining,
8684 hand_count,
8785 tele_count,
88- tele_points,
8986 commands,
9087 }
9188 }
@@ -193,32 +190,11 @@ impl<'a> State<'a> {
193190 self . commands . push ( Command :: NewHand ( new_hand) ) ;
194191 }
195192
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-
202193 self . pass_current_point ( ) ;
203194
204195 let base_moves = self . find_shortest_path ( self . current_point ) ;
205196
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 {
222198 self . current_point = self . current_point . move_with ( & m) ;
223199 self . pass_current_point ( ) ;
224200 self . commands . push ( Command :: Move ( m. clone ( ) ) ) ;
0 commit comments