結果
| 問題 | No.486 3 Straight Win(3連勝) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-25 11:11:03 |
| 言語 | PHP (8.5.2) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 2,000 ms |
| コード長 | 306 bytes |
| 記録 | |
| コンパイル時間 | 2,484 ms |
| コンパイル使用メモリ | 37,624 KB |
| 実行使用メモリ | 38,044 KB |
| 最終ジャッジ日時 | 2026-03-12 17:35:44 |
| 合計ジャッジ時間 | 4,296 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;