結果
問題 | No.805 UMG |
ユーザー |
![]() |
提出日時 | 2020-10-12 19:45:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 197 bytes |
コンパイル時間 | 145 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-18 14:07:36 |
合計ジャッジ時間 | 1,836 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 RE * 19 |
ソースコード
N = int(input().strip())S = input().strip()cnt = 0for i in range(N-2):if S[i] == 'U':cnt += len([j for j in range(1, (N-i) // 2 + 1) if S[j+i] == 'M' and S[j*2+i] == 'G'])print(cnt)