結果

問題 No.457 (^^*)
ユーザー shiccocsanshiccocsan
提出日時 2016-12-08 08:28:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 349 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 9,076 KB
最終ジャッジ日時 2023-08-18 22:15:16
合計ジャッジ時間 5,365 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
8,976 KB
testcase_01 AC 27 ms
8,984 KB
testcase_02 AC 25 ms
8,984 KB
testcase_03 AC 24 ms
9,076 KB
testcase_04 AC 24 ms
8,928 KB
testcase_05 AC 24 ms
9,036 KB
testcase_06 AC 25 ms
8,904 KB
testcase_07 AC 47 ms
8,900 KB
testcase_08 AC 128 ms
8,972 KB
testcase_09 AC 490 ms
8,988 KB
testcase_10 TLE -
testcase_11 -- -
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"\^.*\^.*\*")

rc = 0
lc = 0
for i in range(len(S)):
    for j in range(i + 4, len(S)):
        if S[i] == '(' and S[j] == ')':
            if right.search(S[i + 1:j]):
                rc += 1
            if left.search(S[i + 1:j]):
                lc += 1

print(lc, rc)
0