結果

問題 No.123 カードシャッフル
ユーザー GoryudyumaGoryudyuma
提出日時 2015-03-16 16:38:01
言語 PHP
(8.3.4)
結果
AC  
実行時間 98 ms / 5,000 ms
コード長 274 bytes
コンパイル時間 785 ms
コンパイル使用メモリ 18,620 KB
実行使用メモリ 26,996 KB
最終ジャッジ日時 2023-09-11 08:29:35
合計ジャッジ時間 1,974 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,648 KB
testcase_01 AC 16 ms
18,912 KB
testcase_02 AC 16 ms
18,896 KB
testcase_03 AC 16 ms
18,764 KB
testcase_04 AC 16 ms
18,892 KB
testcase_05 AC 16 ms
18,884 KB
testcase_06 AC 16 ms
18,840 KB
testcase_07 AC 16 ms
18,892 KB
testcase_08 AC 16 ms
18,820 KB
testcase_09 AC 16 ms
18,880 KB
testcase_10 AC 44 ms
24,944 KB
testcase_11 AC 97 ms
26,968 KB
testcase_12 AC 98 ms
26,916 KB
testcase_13 AC 98 ms
26,996 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
list($N,$M)=explode(' ',trim(fgets(STDIN)));
$data=explode(' ',trim(fgets(STDIN)));
$a=array();
for($i=0;$i<$N;$i++){
	array_push($a,$i+1);
}

for($i=0;$i<$M;$i++){
	array_unshift($a,$a[$data[$i]-1]);
	unset($a[$data[$i]]);
	$a=array_merge($a);
}

echo $a[0].PHP_EOL;
0