結果
| 問題 | No.805 UMG |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-03-22 21:55:32 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 410 bytes |
| 記録 | |
| コンパイル時間 | 416 ms |
| コンパイル使用メモリ | 86,016 KB |
| 実行使用メモリ | 75,392 KB |
| 最終ジャッジ日時 | 2026-05-13 01:12:44 |
| 合計ジャッジ時間 | 5,223 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 15 TLE * 1 -- * 4 |
ソースコード
from collections import defaultdict
from sys import stdin
def main():
N = int(input())
S = input()
txt = defaultdict(list)
for i, s in enumerate(S, start=1):
txt[s].append(i)
ans = 0
for j in txt['M']:
for i in txt['U']:
k = j - i + j
if k in txt['G']:
ans += 1
print(ans)
input = lambda: stdin.readline().rstrip()
main()