結果

問題 No.457 (^^*)
ユーザー 12354865271235486527
提出日時 2019-12-21 14:25:19
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 758 ms / 2,000 ms
コード長 610 bytes
コンパイル時間 950 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2023-09-26 14:22:24
合計ジャッジ時間 6,027 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,984 KB
testcase_01 AC 75 ms
71,072 KB
testcase_02 AC 73 ms
71,244 KB
testcase_03 AC 72 ms
71,328 KB
testcase_04 AC 72 ms
71,036 KB
testcase_05 AC 71 ms
71,312 KB
testcase_06 AC 73 ms
71,068 KB
testcase_07 AC 100 ms
75,784 KB
testcase_08 AC 87 ms
75,908 KB
testcase_09 AC 93 ms
76,148 KB
testcase_10 AC 130 ms
76,468 KB
testcase_11 AC 248 ms
76,824 KB
testcase_12 AC 581 ms
77,416 KB
testcase_13 AC 755 ms
77,440 KB
testcase_14 AC 76 ms
75,932 KB
testcase_15 AC 545 ms
77,420 KB
testcase_16 AC 758 ms
77,432 KB
testcase_17 AC 76 ms
75,916 KB
testcase_18 AC 71 ms
71,180 KB
testcase_19 AC 73 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
n = len(S)
l = r = 0
for i in range(n-4):
    if S[i] != '(':
        continue
    lf = rf = False
    lt = rt = ''
    for s in S[i+1:]:
        if s == ')':
            l += lf
            r += rf
        elif not lf & rf:
            if s == '*':
                if lt == '^^':
                    lf = True
                if rt == '':
                    rt += s
            elif s == '^':
                if lt == '' or lt == '^':
                    lt += s
                if rt == '*':
                    rt += s
                elif rt == '*^':
                    rf = True
print(l, r)
0