結果
| 問題 |
No.805 UMG
|
| コンテスト | |
| ユーザー |
Yamada
|
| 提出日時 | 2019-04-12 17:19:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 248 bytes |
| コンパイル時間 | 527 ms |
| コンパイル使用メモリ | 82,564 KB |
| 実行使用メモリ | 63,984 KB |
| 最終ジャッジ日時 | 2024-11-18 13:44:16 |
| 合計ジャッジ時間 | 13,271 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 15 TLE * 5 |
ソースコード
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 i in dic["U"]:
for j in dic["G"]:
if (i+j)%2==0 and (i+j)//2 in dic["M"]:
ans += 1
print(ans)
Yamada