結果

問題 No.805 UMG
ユーザー finefine
提出日時 2019-03-22 21:35:46
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 193 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 1,857 ms
コンパイル使用メモリ 86,752 KB
実行使用メモリ 76,536 KB
最終ジャッジ日時 2023-08-11 19:11:16
合計ジャッジ時間 4,635 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,072 KB
testcase_01 AC 76 ms
75,840 KB
testcase_02 AC 75 ms
75,972 KB
testcase_03 AC 74 ms
75,860 KB
testcase_04 AC 71 ms
71,136 KB
testcase_05 AC 71 ms
71,168 KB
testcase_06 AC 70 ms
70,984 KB
testcase_07 AC 75 ms
75,776 KB
testcase_08 AC 76 ms
75,788 KB
testcase_09 AC 75 ms
75,860 KB
testcase_10 AC 70 ms
71,428 KB
testcase_11 AC 73 ms
75,844 KB
testcase_12 AC 67 ms
71,020 KB
testcase_13 AC 77 ms
75,788 KB
testcase_14 AC 70 ms
71,432 KB
testcase_15 AC 83 ms
76,192 KB
testcase_16 AC 82 ms
76,172 KB
testcase_17 AC 80 ms
76,408 KB
testcase_18 AC 82 ms
76,492 KB
testcase_19 AC 78 ms
76,400 KB
testcase_20 AC 80 ms
76,340 KB
testcase_21 AC 86 ms
76,268 KB
testcase_22 AC 82 ms
76,368 KB
testcase_23 AC 189 ms
76,292 KB
testcase_24 AC 190 ms
76,392 KB
testcase_25 AC 193 ms
76,528 KB
testcase_26 AC 188 ms
76,368 KB
testcase_27 AC 189 ms
76,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

print(ans)
0