結果

問題 No.123 カードシャッフル
ユーザー teioteio
提出日時 2020-07-29 10:18:53
言語 Perl
(5.38.2)
結果
AC  
実行時間 47 ms / 5,000 ms
コード長 259 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 15,032 KB
最終ジャッジ日時 2023-09-11 07:11:38
合計ジャッジ時間 1,377 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,464 KB
testcase_01 AC 2 ms
4,576 KB
testcase_02 AC 3 ms
4,652 KB
testcase_03 AC 3 ms
4,504 KB
testcase_04 AC 3 ms
4,592 KB
testcase_05 AC 2 ms
4,568 KB
testcase_06 AC 2 ms
4,660 KB
testcase_07 AC 2 ms
4,576 KB
testcase_08 AC 2 ms
4,568 KB
testcase_09 AC 2 ms
4,576 KB
testcase_10 AC 2 ms
4,592 KB
testcase_11 AC 45 ms
14,908 KB
testcase_12 AC 47 ms
14,956 KB
testcase_13 AC 47 ms
15,032 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

# use strict;
# use warnings;

chomp(my $x = <>);
my $N = (split(/ /, $x))[0];
my @c = reverse(1 .. $N);
if ($N != 1) {
    chomp(my $y = <>);
    my @As = split(/ /, $y);
    foreach (@As) {
        push(@c, splice(@c, -$_, 1));
    }
}
print($c[-1], "\n");
0