結果

問題 No.805 UMG
ユーザー pasoconhoshiipasoconhoshii
提出日時 2019-03-23 09:00:53
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 325 bytes
コンパイル時間 1,134 ms
コンパイル使用メモリ 10,520 KB
実行使用メモリ 7,880 KB
最終ジャッジ日時 2023-08-11 19:22:11
合計ジャッジ時間 14,377 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,756 KB
testcase_01 AC 17 ms
7,780 KB
testcase_02 AC 15 ms
7,784 KB
testcase_03 AC 15 ms
7,784 KB
testcase_04 AC 15 ms
7,764 KB
testcase_05 AC 15 ms
7,720 KB
testcase_06 AC 15 ms
7,872 KB
testcase_07 AC 15 ms
7,880 KB
testcase_08 AC 15 ms
7,776 KB
testcase_09 AC 16 ms
7,844 KB
testcase_10 AC 15 ms
7,756 KB
testcase_11 AC 15 ms
7,692 KB
testcase_12 AC 15 ms
7,784 KB
testcase_13 AC 16 ms
7,720 KB
testcase_14 AC 15 ms
7,716 KB
testcase_15 AC 79 ms
7,792 KB
testcase_16 AC 76 ms
7,796 KB
testcase_17 AC 52 ms
7,688 KB
testcase_18 AC 102 ms
7,872 KB
testcase_19 AC 44 ms
7,848 KB
testcase_20 AC 101 ms
7,776 KB
testcase_21 AC 62 ms
7,876 KB
testcase_22 AC 72 ms
7,840 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()


ans = 0
for stride in range(1, N//2+1):
    for k in range(0+stride, N-stride+1):
        i = k - stride
        j = k + stride

        if j >= N:
            continue
        
        if S[i] == "U" and \
           S[k] == "M" and \
           S[j] == "G":
               ans += 1
print(ans)
0