結果
問題 | No.457 (^^*) |
ユーザー | compass19 |
提出日時 | 2016-12-10 22:01:54 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 643 bytes |
コンパイル時間 | 249 ms |
コンパイル使用メモリ | 10,812 KB |
実行使用メモリ | 12,712 KB |
最終ジャッジ日時 | 2023-08-19 10:35:12 |
合計ジャッジ時間 | 4,610 ms |
ジャッジサーバーID (参考情報) |
judge9 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
12,144 KB |
testcase_01 | AC | 16 ms
7,736 KB |
testcase_02 | AC | 15 ms
7,796 KB |
testcase_03 | AC | 16 ms
7,812 KB |
testcase_04 | AC | 16 ms
7,848 KB |
testcase_05 | AC | 15 ms
7,792 KB |
testcase_06 | AC | 16 ms
7,788 KB |
testcase_07 | AC | 16 ms
7,876 KB |
testcase_08 | AC | 17 ms
7,780 KB |
testcase_09 | AC | 17 ms
7,736 KB |
testcase_10 | AC | 26 ms
7,808 KB |
testcase_11 | AC | 66 ms
8,224 KB |
testcase_12 | TLE | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
ソースコード
s = input() left_pos = [i for i, k in enumerate(s) if k == '('] def left_solve(): res = 0 for i in left_pos: tmp = s[i+1:] count = 0 for j, elm in enumerate(tmp): if count < 2: if elm == '^': count += 1 else: if elm == '*': res += tmp[j+1:].count(')') break return res def right_solve(): res = 0 for i in left_pos: tmp = s[i+1:] count = 0 for j, elm in enumerate(tmp): if count < 1: if elm == '*': count += 1 elif count < 2: if elm == '^': count += 1 else: if elm == '^': res += tmp[j+1:].count(')') break return res print(left_solve(), right_solve())