結果

問題 No.805 UMG
ユーザー motor_radialmotor_radial
提出日時 2019-08-22 20:37:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 76,520 KB
最終ジャッジ日時 2023-08-11 19:41:27
合計ジャッジ時間 4,630 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
75,580 KB
testcase_01 AC 85 ms
75,828 KB
testcase_02 AC 79 ms
75,792 KB
testcase_03 AC 80 ms
75,760 KB
testcase_04 AC 75 ms
71,288 KB
testcase_05 AC 75 ms
71,296 KB
testcase_06 AC 74 ms
71,256 KB
testcase_07 AC 78 ms
75,756 KB
testcase_08 AC 81 ms
75,872 KB
testcase_09 AC 79 ms
75,784 KB
testcase_10 AC 72 ms
71,384 KB
testcase_11 AC 77 ms
75,840 KB
testcase_12 AC 76 ms
71,388 KB
testcase_13 AC 83 ms
75,932 KB
testcase_14 AC 76 ms
71,184 KB
testcase_15 AC 92 ms
76,408 KB
testcase_16 AC 88 ms
76,376 KB
testcase_17 AC 88 ms
76,340 KB
testcase_18 AC 88 ms
76,376 KB
testcase_19 AC 87 ms
76,340 KB
testcase_20 AC 92 ms
76,520 KB
testcase_21 AC 89 ms
76,256 KB
testcase_22 AC 86 ms
76,120 KB
testcase_23 AC 216 ms
76,352 KB
testcase_24 AC 208 ms
76,420 KB
testcase_25 AC 203 ms
76,360 KB
testcase_26 AC 204 ms
76,212 KB
testcase_27 AC 204 ms
76,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
S=list(input())
cnt=0
for i in range(N):
    for k in range(i+1,N):
        if (k*2-i)>=N or k*2-i<0: continue
        if S[i]=="U" and S[k]=="M" and S[k*2-i]=="G":
            cnt+=1
print(cnt)
0