結果
問題 | No.805 UMG |
ユーザー |
![]() |
提出日時 | 2019-04-01 15:36:10 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 86 ms / 2,000 ms |
コード長 | 269 bytes |
コンパイル時間 | 269 ms |
コンパイル使用メモリ | 82,464 KB |
実行使用メモリ | 65,328 KB |
最終ジャッジ日時 | 2024-11-18 13:38:15 |
合計ジャッジ時間 | 2,501 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
N = int(input())S = list(input())c = S.count("U")count = 0i = 0while c > 0:if S[i] == "U":for j in range(int((N-i-1)/2)):if S[i+j+1] == "M" and S[i+2*(j+1)] == "G":count += 1c -= 1i += 1print(count)