結果

問題 No.805 UMG
ユーザー YamadaYamada
提出日時 2019-04-12 17:25:54
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 268 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 61,568 KB
最終ジャッジ日時 2024-04-29 10:54:11
合計ジャッジ時間 15,344 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,584 KB
testcase_01 AC 41 ms
51,712 KB
testcase_02 AC 41 ms
51,456 KB
testcase_03 AC 42 ms
51,584 KB
testcase_04 AC 41 ms
51,840 KB
testcase_05 AC 41 ms
51,584 KB
testcase_06 AC 42 ms
51,328 KB
testcase_07 AC 44 ms
51,456 KB
testcase_08 AC 42 ms
51,456 KB
testcase_09 AC 42 ms
51,456 KB
testcase_10 AC 41 ms
51,584 KB
testcase_11 AC 42 ms
51,840 KB
testcase_12 AC 42 ms
51,968 KB
testcase_13 AC 43 ms
51,584 KB
testcase_14 AC 41 ms
51,584 KB
testcase_15 AC 64 ms
58,496 KB
testcase_16 AC 59 ms
58,240 KB
testcase_17 AC 54 ms
58,496 KB
testcase_18 AC 67 ms
58,880 KB
testcase_19 AC 53 ms
58,368 KB
testcase_20 AC 67 ms
58,496 KB
testcase_21 AC 56 ms
58,240 KB
testcase_22 AC 60 ms
58,496 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N =int(input())
S =[i for i in input()]
dic = {"U":[],"M":[],"G":[]}
for i,str in enumerate(S):
    dic[str].append(i)
ans = 0
for j in dic["M"]:
    for i in dic["U"]:
        if i > j:
            break
        if 2*j - i in dic["G"]:
            ans += 1
print(ans)
0