結果

問題 No.457 (^^*)
ユーザー shiccocsanshiccocsan
提出日時 2016-12-08 21:47:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 497 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 12,344 KB
最終ジャッジ日時 2023-08-19 02:35:31
合計ジャッジ時間 4,952 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
7,964 KB
testcase_01 AC 13 ms
7,844 KB
testcase_02 AC 13 ms
7,824 KB
testcase_03 AC 13 ms
7,804 KB
testcase_04 AC 14 ms
7,756 KB
testcase_05 AC 14 ms
7,852 KB
testcase_06 AC 14 ms
7,804 KB
testcase_07 AC 21 ms
7,836 KB
testcase_08 AC 48 ms
7,780 KB
testcase_09 AC 133 ms
7,800 KB
testcase_10 AC 841 ms
8,000 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# import re

S = input()

#right = re.compile(r"\*.*\^.*\^")
#left = re.compile(r"\^.*\^.*\*")

L = '(^^*)'
R = '(*^^)'
rc = 0
lc = 0
for i in range(len(S)-4):
    ri = 0
    li = 0
    if S[i] != '(':
        continue
    for j in range(i, len(S)):
        if L[li] == S[j]:
            if li == 4:
                lc += 1
            else:
                li += 1
        if R[ri] == S[j]:
            if ri == 4:
                rc += 1
            else:
                ri += 1

print(lc, rc)
0