結果

問題 No.26 シャッフルゲーム
ユーザー ayaaya
提出日時 2019-07-24 16:55:38
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 55 ms
コンパイル使用メモリ 18,720 KB
実行使用メモリ 19,108 KB
最終ジャッジ日時 2023-09-10 10:19:22
合計ジャッジ時間 1,014 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

<?php
//No.26 シャッフルゲーム

//N:あたりの番号、M:入れ替える回数
$N=trim(fgets(STDIN));
$M=trim(fgets(STDIN));

for($i=1;$i<=$M;$i++){
  $line=trim(fgets(STDIN));
  $lines=explode(" ",$line);
  if($lines[$i-1]===$N){
    $N=$lines[$i];
  }else if($lines[$i]===$N){
    $N=$lines[$i-1];
  }
}
echo $N;
?>
0