結果

問題 No.5 数字のブロック
ユーザー sironekotorosironekotoro
提出日時 2018-12-08 10:51:36
言語 Perl
(5.38.2)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 252 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 5,388 KB
実行使用メモリ 7,028 KB
最終ジャッジ日時 2023-08-11 18:42:47
合計ジャッジ時間 1,530 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,700 KB
testcase_01 AC 3 ms
4,764 KB
testcase_02 AC 2 ms
4,660 KB
testcase_03 AC 8 ms
6,252 KB
testcase_04 AC 7 ms
5,868 KB
testcase_05 AC 10 ms
6,456 KB
testcase_06 AC 7 ms
5,772 KB
testcase_07 AC 6 ms
5,712 KB
testcase_08 AC 7 ms
6,012 KB
testcase_09 AC 4 ms
5,172 KB
testcase_10 AC 9 ms
6,592 KB
testcase_11 AC 6 ms
5,684 KB
testcase_12 AC 7 ms
6,116 KB
testcase_13 AC 9 ms
6,448 KB
testcase_14 AC 3 ms
4,776 KB
testcase_15 AC 3 ms
4,828 KB
testcase_16 AC 9 ms
6,572 KB
testcase_17 AC 10 ms
7,028 KB
testcase_18 AC 10 ms
6,744 KB
testcase_19 AC 11 ms
6,956 KB
testcase_20 AC 2 ms
4,656 KB
testcase_21 AC 3 ms
4,780 KB
testcase_22 AC 3 ms
4,708 KB
testcase_23 AC 3 ms
4,756 KB
testcase_24 AC 3 ms
4,820 KB
testcase_25 AC 3 ms
4,888 KB
testcase_26 AC 3 ms
4,676 KB
testcase_27 AC 2 ms
4,676 KB
testcase_28 AC 2 ms
4,648 KB
testcase_29 AC 6 ms
5,852 KB
testcase_30 AC 4 ms
5,176 KB
testcase_31 AC 2 ms
4,672 KB
testcase_32 AC 3 ms
4,804 KB
testcase_33 AC 2 ms
4,820 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Useless use of addition (+) in void context at Main.pl line 18.
Main.pl syntax OK

ソースコード

diff #

use v5.16;

my $L = <>;
my $N = <>;
my $W = <>;

chomp( $L, $N, $W );

my @W = sort { $a <=> $b } ( split / /, $W );

while ( my ( $i, $e ) = each @W ) {
    $L = $L - $e;
    if ( $L < 0 ) {
        say $i;
        exit;
    }
}
say( scalar @W ) + 1;
0