結果
問題 |
No.805 UMG
|
ユーザー |
![]() |
提出日時 | 2019-03-17 14:12:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 193 ms / 2,000 ms |
コード長 | 221 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 81,428 KB |
実行使用メモリ | 65,288 KB |
最終ジャッジ日時 | 2024-11-18 13:08:46 |
合計ジャッジ時間 | 2,929 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
N = int(input()) S = input() ans = 0 for i in range(N): for j in range(N): if i>=j or (i+j)%2==1: continue if S[i]=='U' and S[(i+j)//2]=='M' and S[j]=='G': ans += 1 print(ans)