]> www.fi.muni.cz Git - aoc.git/blob - 2016/37.pl
Day 25: examining the input
[aoc.git] / 2016 / 37.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use v5.30;
5
6 # my $in = 3004953;
7 my $in = shift;
8
9 my @elves = (1 .. $in);
10 my $now = 0;
11 while (@elves > 1) {
12         @elves = grep { $now = !$now } @elves;
13         say join(' ', @elves);
14 }
15 say $elves[0];