結果

問題 No.457 (^^*)
ユーザー ebicochinealebicochineal
提出日時 2016-12-08 23:37:25
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 489 bytes
コンパイル時間 833 ms
コンパイル使用メモリ 86,508 KB
実行使用メモリ 84,972 KB
最終ジャッジ日時 2023-08-19 02:37:41
合計ジャッジ時間 5,741 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
78,156 KB
testcase_01 AC 59 ms
71,164 KB
testcase_02 AC 59 ms
71,128 KB
testcase_03 AC 59 ms
71,248 KB
testcase_04 AC 59 ms
71,252 KB
testcase_05 AC 63 ms
71,316 KB
testcase_06 AC 64 ms
71,244 KB
testcase_07 AC 67 ms
75,976 KB
testcase_08 AC 81 ms
76,520 KB
testcase_09 AC 142 ms
76,584 KB
testcase_10 AC 1,036 ms
77,576 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#! /usr/bin/env python3

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[s+1: e]
                if '*' in i:
                    lcnt += i.rsplit('*', 1)[0].count('^') > 1
                    rcnt += i.split('*', 1)[1].count('^') > 1
    print(lcnt, rcnt)

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