結果

問題 No.26 シャッフルゲーム
ユーザー papinianuspapinianus
提出日時 2016-06-01 10:40:59
言語 PHP
(8.2.11)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 292 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 18,676 KB
実行使用メモリ 18,948 KB
最終ジャッジ日時 2023-07-29 16:49:45
合計ジャッジ時間 891 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,948 KB
testcase_01 AC 15 ms
18,864 KB
testcase_02 AC 15 ms
18,908 KB
testcase_03 AC 15 ms
18,900 KB
testcase_04 AC 14 ms
18,912 KB
testcase_05 AC 15 ms
18,812 KB
testcase_06 AC 15 ms
18,812 KB
testcase_07 AC 15 ms
18,944 KB
testcase_08 AC 15 ms
18,836 KB
testcase_09 AC 15 ms
18,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$curpos = trim(fgets(STDIN));
$count = trim(fgets(STDIN));
for($i = 0; $i < $count; $i++) {
    list($src, $dst) = explode(' ', trim(fgets(STDIN)));
    if($src == $curpos) {
        $curpos = $dst;
    } else if ($dst == $curpos) {
        $curpos = $src;
    }
}
echo $curpos.PHP_EOL;
0