結果
| 問題 |
No.805 UMG
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-27 17:33:31 |
| 言語 | PHP (843.2) |
| 結果 |
AC
|
| 実行時間 | 689 ms / 2,000 ms |
| コード長 | 371 bytes |
| コンパイル時間 | 1,025 ms |
| コンパイル使用メモリ | 32,404 KB |
| 実行使用メモリ | 32,532 KB |
| 最終ジャッジ日時 | 2024-11-18 13:36:00 |
| 合計ジャッジ時間 | 6,188 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
while ($line = fgets(STDIN)) {
$array[] = trim($line);
}
$length = array_splice($array, 0, 1);
$words = str_split($array[0]);
$answer = 0;
for ($i=0; $i<$length[0]; $i++) {
for ($j=0; $j<floor(($length[0]-$i+1)/2); $j++) {
if ($words[$i] == "U") {
if ($words[$i+$j] == "M" and $words[$i+2*$j] == "G") {
$answer++;
}
}
}
}
echo $answer.PHP_EOL;
?>