結果
問題 | No.805 UMG |
ユーザー |
![]() |
提出日時 | 2019-03-22 21:51:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 86 ms / 2,000 ms |
コード長 | 201 bytes |
コンパイル時間 | 370 ms |
コンパイル使用メモリ | 82,396 KB |
実行使用メモリ | 65,316 KB |
最終ジャッジ日時 | 2024-11-18 13:18:50 |
合計ジャッジ時間 | 2,882 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
n = int(input()) s = input() ans = 0 for i in range(n): if s[i] == "M": for j in range(1, min(i+1, n-i)): if s[i-j] == "U" and s[i+j] == "G": ans += 1 print(ans)