結果
| 問題 |
No.805 UMG
|
| コンテスト | |
| ユーザー |
nohakai3
|
| 提出日時 | 2022-07-26 11:52:51 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 142 ms / 2,000 ms |
| コード長 | 209 bytes |
| コンパイル時間 | 352 ms |
| コンパイル使用メモリ | 82,116 KB |
| 実行使用メモリ | 64,688 KB |
| 最終ジャッジ日時 | 2024-11-18 14:16:41 |
| 合計ジャッジ時間 | 3,073 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
n=int(input())
s=input()
ans=0
for i in range(n-1):
for j in range(i+1,n):
if (i+j)%2==1:
continue
if s[i]=="U" and s[(i+j)//2]=="M" and s[j]=="G":
ans+=1
print(ans)
nohakai3