結果
| 問題 |
No.805 UMG
|
| コンテスト | |
| ユーザー |
fV9TwBhUoa9S3eV
|
| 提出日時 | 2019-10-28 14:38:52 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 262 bytes |
| コンパイル時間 | 231 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-11-18 13:54:29 |
| 合計ジャッジ時間 | 1,823 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 RE * 19 |
ソースコード
# No.805 UMG
n = int(input())
s = input()
count = 0
for i in range(n - 2):
if s[i] == 'U':
for j in range(i, n - 1):
if j + j - i <= n:
if s[j] == 'M' and s[j + j - i] == 'G':
count += 1
print(count)
fV9TwBhUoa9S3eV