結果

問題 No.457 (^^*)
ユーザー ebicochinealebicochineal
提出日時 2016-12-09 00:05:04
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 471 bytes
コンパイル時間 2,065 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 80,712 KB
最終ジャッジ日時 2023-08-19 02:37:50
合計ジャッジ時間 5,573 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
75,464 KB
testcase_01 AC 69 ms
71,236 KB
testcase_02 AC 69 ms
71,260 KB
testcase_03 AC 69 ms
71,420 KB
testcase_04 AC 69 ms
71,204 KB
testcase_05 AC 70 ms
71,100 KB
testcase_06 AC 69 ms
71,208 KB
testcase_07 AC 77 ms
75,848 KB
testcase_08 AC 86 ms
75,852 KB
testcase_09 AC 125 ms
75,884 KB
testcase_10 AC 687 ms
76,684 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    S = input()
    l, r = [], []
    lcnt = rcnt = 0
    for i in range(len(S)):
        if S[i] == '(' : l += [i]
        if S[i] == ')' : r += [i]
    for s in l:
        for e in r:
            if s < e:
                i = S.find('*', s+1, e)
                if i > -1:
                    lcnt += S.count('^', s+1, S.rfind('*', s+1, e)) > 1
                    rcnt += S.count('^', i, e) > 1
    print(lcnt, rcnt)

if __name__ == '__main__':
    main()
0