結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,024 KB
testcase_01 AC 30 ms
9,992 KB
testcase_02 AC 30 ms
9,992 KB
testcase_03 AC 29 ms
9,992 KB
testcase_04 AC 29 ms
9,992 KB
testcase_05 AC 30 ms
9,992 KB
testcase_06 AC 30 ms
9,992 KB
testcase_07 AC 45 ms
10,000 KB
testcase_08 AC 137 ms
10,012 KB
testcase_09 AC 622 ms
10,052 KB
testcase_10 TLE -
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)


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 s[k] == "*":
                if s[k:j+1].count("^") >= 2:
                    right_counter += 1
                    break
        for k in range(j,i,-1):
            if s[k] == "*":
                if s[i:k].count("^") >= 2:
                    left_counter += 1
                    break

print(left_counter,right_counter)
0