結果

問題 No.805 UMG
ユーザー GrayCoderGrayCoder
提出日時 2019-03-22 21:55:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 72,576 KB
最終ジャッジ日時 2024-04-29 10:34:13
合計ジャッジ時間 5,387 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
58,752 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 46 ms
53,120 KB
testcase_04 AC 46 ms
53,632 KB
testcase_05 AC 45 ms
53,504 KB
testcase_06 AC 46 ms
53,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 45 ms
53,632 KB
testcase_11 WA -
testcase_12 AC 45 ms
53,760 KB
testcase_13 WA -
testcase_14 AC 46 ms
53,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
from sys import stdin

def main():
    N = int(input())
    S = input()

    txt = defaultdict(list)
    for i, s in enumerate(S, start=1):
        txt[s].append(i)

    ans = 0
    for j in txt['M']:
        for i in txt['U']:
            k = j - i + j
            if k in txt['G']:
                ans += 1
    print(ans)

input = lambda: stdin.readline().rstrip()
main()
0