結果
| 問題 |
No.2021 Not A but B
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-19 10:15:58 |
| 言語 | PHP (843.2) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 290 bytes |
| コンパイル時間 | 2,579 ms |
| コンパイル使用メモリ | 29,808 KB |
| 実行使用メモリ | 31,632 KB |
| 最終ジャッジ日時 | 2024-11-18 00:23:37 |
| 合計ジャッジ時間 | 2,683 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 4 |
| other | RE * 26 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
$n = trim(fgets(STDIN));
$word = trim(fgets(STDIN));
$count = 0;
for ($i = 0; $i < $n; $i++) {
if ($word($i) == "A" && $word($i+1) == "A") {
$count++;
}elseif ($word($i) !== $word($i+1) && $word($i+1) !== $word($i-1)) {
$count;
}
}
echo $count;
?>