This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use feature qw/say/; | |
use HTTP::Request::Common; | |
use LWP::UserAgent; | |
use Time::HiRes; | |
use JSON; | |
my $ua = LWP::UserAgent->new; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my (@price,@day); | |
<STDIN> =~ /(\d+) (\d+)/; | |
$price[$_] = <STDIN> for (0..($1-1)); | |
$day[$_] = <STDIN> for (0..($2-1)); | |
@price = sort {$a <=> $b} @price; | |
for my $setprice (@day){ | |
my @tmp = grep { $_ <= $setprice - $price[0] } @price; | |
my $check = 0; |