結果

問題 No.805 UMG
ユーザー miya145592miya145592
提出日時 2023-05-27 20:58:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 76,576 KB
最終ジャッジ日時 2023-08-27 00:11:53
合計ジャッジ時間 4,816 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
75,844 KB
testcase_01 AC 73 ms
75,988 KB
testcase_02 AC 74 ms
71,540 KB
testcase_03 AC 72 ms
75,808 KB
testcase_04 AC 70 ms
71,500 KB
testcase_05 AC 68 ms
71,256 KB
testcase_06 AC 69 ms
71,552 KB
testcase_07 AC 69 ms
75,860 KB
testcase_08 AC 73 ms
76,384 KB
testcase_09 AC 70 ms
75,840 KB
testcase_10 AC 69 ms
71,260 KB
testcase_11 AC 70 ms
71,260 KB
testcase_12 AC 69 ms
71,268 KB
testcase_13 AC 73 ms
75,812 KB
testcase_14 AC 67 ms
71,272 KB
testcase_15 AC 89 ms
76,132 KB
testcase_16 AC 80 ms
76,452 KB
testcase_17 AC 78 ms
76,448 KB
testcase_18 AC 79 ms
76,576 KB
testcase_19 AC 75 ms
76,420 KB
testcase_20 AC 77 ms
76,448 KB
testcase_21 AC 78 ms
76,196 KB
testcase_22 AC 77 ms
76,404 KB
testcase_23 AC 167 ms
76,516 KB
testcase_24 AC 178 ms
76,508 KB
testcase_25 AC 172 ms
76,236 KB
testcase_26 AC 171 ms
76,440 KB
testcase_27 AC 178 ms
76,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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