結果

問題 No.457 (^^*)
ユーザー Konton7Konton7
提出日時 2019-05-18 09:00:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 787 bytes
コンパイル時間 803 ms
コンパイル使用メモリ 11,760 KB
実行使用メモリ 14,424 KB
最終ジャッジ日時 2023-10-17 07:34:41
合計ジャッジ時間 6,215 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,024 KB
testcase_01 AC 30 ms
9,992 KB
testcase_02 AC 29 ms
9,992 KB
testcase_03 AC 29 ms
9,992 KB
testcase_04 AC 29 ms
9,992 KB
testcase_05 AC 29 ms
9,992 KB
testcase_06 AC 31 ms
9,992 KB
testcase_07 AC 123 ms
10,000 KB
testcase_08 AC 990 ms
10,024 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()

left_list = []
right_list = []
astr_list = []
hat_list = []

for i in range(len(s)):
    if s[i] == "(":
        left_list.append(i)
    elif s[i] == ")":
        right_list.append(i)
    elif s[i] == "*":
        astr_list.append(i)
    else:
        hat_list.append(i)

left_counter = 0
right_counter = 0
for i in left_list:
    right_for_i = [ j for j in right_list if j > i+2 ]
    for j in right_for_i:
        for k in range(i,j):
            if k in astr_list:
                if s[k:j+1].count("^") >= 2:
                    right_counter += 1
                break
        for k in range(j,i,-1):
            if k in astr_list:
                if s[i:k].count("^") >= 2:
                    left_counter += 1
                break

print(left_counter,right_counter)
0