結果

問題 No.805 UMG
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-19 08:30:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 76,644 KB
最終ジャッジ日時 2023-08-11 19:50:00
合計ジャッジ時間 4,212 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,924 KB
testcase_01 AC 78 ms
75,816 KB
testcase_02 AC 76 ms
75,876 KB
testcase_03 AC 82 ms
75,924 KB
testcase_04 AC 72 ms
71,224 KB
testcase_05 AC 74 ms
71,364 KB
testcase_06 AC 75 ms
71,184 KB
testcase_07 AC 76 ms
75,760 KB
testcase_08 AC 80 ms
75,840 KB
testcase_09 AC 79 ms
75,916 KB
testcase_10 AC 73 ms
71,252 KB
testcase_11 AC 77 ms
75,928 KB
testcase_12 AC 74 ms
71,120 KB
testcase_13 AC 80 ms
75,848 KB
testcase_14 AC 73 ms
71,308 KB
testcase_15 AC 86 ms
76,344 KB
testcase_16 AC 86 ms
76,512 KB
testcase_17 AC 83 ms
76,540 KB
testcase_18 AC 83 ms
76,644 KB
testcase_19 AC 84 ms
76,424 KB
testcase_20 AC 88 ms
76,392 KB
testcase_21 AC 85 ms
76,556 KB
testcase_22 AC 84 ms
76,424 KB
testcase_23 AC 161 ms
76,208 KB
testcase_24 AC 176 ms
76,480 KB
testcase_25 AC 180 ms
76,456 KB
testcase_26 AC 173 ms
76,452 KB
testcase_27 AC 159 ms
76,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = str(input())
ans = 0
for i in range(n-2):
    for k in range(i+2, n):
        if (i+k)%2 != 0:
            continue
        else:
            j = (i+k)//2
            if s[i] == 'U' and s[j] == 'M' and s[k] == 'G':
                ans += 1
print(ans)
0