結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,592 KB
testcase_01 AC 3 ms
4,600 KB
testcase_02 AC 3 ms
4,608 KB
testcase_03 AC 3 ms
4,608 KB
testcase_04 AC 3 ms
4,568 KB
testcase_05 AC 2 ms
4,608 KB
testcase_06 AC 2 ms
4,468 KB
testcase_07 AC 2 ms
4,604 KB
testcase_08 AC 2 ms
4,648 KB
testcase_09 AC 3 ms
4,652 KB
testcase_10 AC 3 ms
4,592 KB
testcase_11 AC 46 ms
14,780 KB
testcase_12 AC 49 ms
15,096 KB
testcase_13 AC 49 ms
15,084 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

# use strict;
# use warnings;

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