結果

問題 No.805 UMG
ユーザー minarucominaruco
提出日時 2021-11-21 01:38:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 567 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 76,592 KB
最終ジャッジ日時 2023-08-11 20:01:33
合計ジャッジ時間 4,915 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,544 KB
testcase_01 AC 80 ms
76,068 KB
testcase_02 AC 78 ms
75,796 KB
testcase_03 AC 78 ms
75,792 KB
testcase_04 AC 73 ms
71,100 KB
testcase_05 AC 73 ms
71,244 KB
testcase_06 AC 72 ms
71,308 KB
testcase_07 AC 78 ms
75,792 KB
testcase_08 AC 81 ms
75,796 KB
testcase_09 AC 79 ms
75,776 KB
testcase_10 AC 72 ms
71,160 KB
testcase_11 AC 77 ms
75,764 KB
testcase_12 AC 72 ms
70,988 KB
testcase_13 AC 81 ms
75,960 KB
testcase_14 AC 72 ms
71,392 KB
testcase_15 AC 90 ms
76,556 KB
testcase_16 AC 86 ms
76,396 KB
testcase_17 AC 86 ms
76,340 KB
testcase_18 AC 86 ms
76,536 KB
testcase_19 AC 83 ms
76,296 KB
testcase_20 AC 89 ms
76,392 KB
testcase_21 AC 89 ms
76,196 KB
testcase_22 AC 87 ms
76,588 KB
testcase_23 AC 210 ms
76,432 KB
testcase_24 AC 215 ms
76,068 KB
testcase_25 AC 212 ms
76,592 KB
testcase_26 AC 211 ms
76,588 KB
testcase_27 AC 213 ms
76,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ans=0
n=int(input())
s=list(input())
for i in range(n):
    for j in range(i+1,n):
        k=2*j-i
        if n-1<k or k<0:
            continue 
        if i<j<k and s[i]=="U" and s[j]=="M" and s[k]=="G":
            ans+=1
print(ans)
0