結果
問題 | No.805 UMG |
ユーザー |
|
提出日時 | 2020-08-04 09:52:43 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 79 ms / 2,000 ms |
コード長 | 177 bytes |
コンパイル時間 | 132 ms |
コンパイル使用メモリ | 81,852 KB |
実行使用メモリ | 62,720 KB |
最終ジャッジ日時 | 2024-11-18 14:05:39 |
合計ジャッジ時間 | 2,279 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
n=int(input()) s=input() ans=0 for i in range(n): if s[i]!='M': continue j=1 while j<=i and i+j<n: if s[i-j]=='U' and s[i+j]=='G': ans+=1 j+=1 print(ans)