結果
問題 | No.805 UMG |
ユーザー |
![]() |
提出日時 | 2020-04-10 20:29:54 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 137 ms / 2,000 ms |
コード長 | 223 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 81,740 KB |
実行使用メモリ | 65,508 KB |
最終ジャッジ日時 | 2024-11-18 14:00:55 |
合計ジャッジ時間 | 2,752 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
n = int(input()) s = input() ret = 0 for i in range(n): for j in range(i+1, n): k = 2*j-i if k>=n: continue elif s[i]=='U' and s[j]=='M' and s[k]=='G': ret += 1 print(ret)