結果
| 問題 | No.805 UMG |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-04 09:52:43 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 53 ms / 2,000 ms |
| コード長 | 177 bytes |
| 記録 | |
| コンパイル時間 | 245 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 63,232 KB |
| 最終ジャッジ日時 | 2026-05-13 02:01:22 |
| 合計ジャッジ時間 | 2,189 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
n=int(input())
s=input()
ans=0
for i in range(n):
if s[i]!='M':
continue
j=1
while j<=i and i+j<n:
if s[i-j]=='U' and s[i+j]=='G':
ans+=1
j+=1
print(ans)