]> www.fi.muni.cz Git - aoc.git/blob - 2023/12.pl
Day 25: examining the input
[aoc.git] / 2023 / 12.pl
1 #!/usr/bin/perl -w
2
3 use v5.38;
4
5 my $t = join('', <> =~ /\d+/g);
6 my $d = join('', <> =~ /\d+/g);
7
8 my $n;
9 for my $t1 (1 .. $t-1) {
10         my $d1 = ($t-$t1)*$t1;
11         $n++ if $d1 > $d;
12         # say "$t1 $n" if $t1 % 10_000 == 0;
13 }
14 say $n;