結果
| 問題 | No.805 UMG |
| コンテスト | |
| ユーザー |
Yamada
|
| 提出日時 | 2019-04-12 17:25:54 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,422 ms / 2,000 ms |
| + 174µs | |
| コード長 | 268 bytes |
| 記録 | |
| コンパイル時間 | 61 ms |
| コンパイル使用メモリ | 82,008 KB |
| 実行使用メモリ | 63,616 KB |
| 最終ジャッジ日時 | 2026-09-25 21:14:21 |
| 合計ジャッジ時間 | 9,181 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
N =int(input())
S =[i for i in input()]
dic = {"U":[],"M":[],"G":[]}
for i,str in enumerate(S):
dic[str].append(i)
ans = 0
for j in dic["M"]:
for i in dic["U"]:
if i > j:
break
if 2*j - i in dic["G"]:
ans += 1
print(ans)
Yamada