結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
|
提出日時 | 2017-02-25 11:11:03 |
言語 | PHP (843.2) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 306 bytes |
コンパイル時間 | 1,649 ms |
コンパイル使用メモリ | 32,020 KB |
実行使用メモリ | 32,400 KB |
最終ジャッジ日時 | 2024-06-26 04:06:00 |
合計ジャッジ時間 | 3,891 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php $str = trim(fgets(STDIN)); $ans = "NA"; $pos = strlen($str); $list = ["OOO"=>"East", "XXX"=>"West"]; foreach($list as $phrase => $team) { $found = strpos($str, $phrase); if( $found !== FALSE && $found < $pos) { $ans = $team; $pos = $found; } } echo $ans; echo PHP_EOL;