結果

問題 No.805 UMG
ユーザー tomarint2tomarint2
提出日時 2019-03-22 21:31:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 76,320 KB
最終ジャッジ日時 2023-08-11 19:09:02
合計ジャッジ時間 4,244 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
75,592 KB
testcase_01 AC 79 ms
75,520 KB
testcase_02 AC 73 ms
71,212 KB
testcase_03 AC 78 ms
75,512 KB
testcase_04 AC 76 ms
71,264 KB
testcase_05 AC 73 ms
71,280 KB
testcase_06 AC 74 ms
71,392 KB
testcase_07 AC 78 ms
75,444 KB
testcase_08 AC 78 ms
76,212 KB
testcase_09 AC 78 ms
75,756 KB
testcase_10 AC 74 ms
71,296 KB
testcase_11 AC 74 ms
71,284 KB
testcase_12 AC 74 ms
71,292 KB
testcase_13 AC 80 ms
75,612 KB
testcase_14 AC 75 ms
71,336 KB
testcase_15 AC 84 ms
76,208 KB
testcase_16 AC 83 ms
76,072 KB
testcase_17 AC 83 ms
76,176 KB
testcase_18 AC 84 ms
76,004 KB
testcase_19 AC 83 ms
76,080 KB
testcase_20 AC 86 ms
76,192 KB
testcase_21 AC 85 ms
76,192 KB
testcase_22 AC 83 ms
75,956 KB
testcase_23 AC 153 ms
76,096 KB
testcase_24 AC 157 ms
76,032 KB
testcase_25 AC 153 ms
76,320 KB
testcase_26 AC 154 ms
76,212 KB
testcase_27 AC 154 ms
76,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
S=list(input())
ans=0
for i in range(N):
    for j in range(1,N):
        if i+j+j>=N:
            break
        #print(i,i+j,i+j+j)
        if S[i]=='U' and S[i+j]=='M' and S[i+j+j]=='G':
            ans+=1
print(ans)
0