結果

問題 No.22 括弧の対応
ユーザー utsumidaisukeutsumidaisuke
提出日時 2018-12-10 17:50:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 222 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 7,944 KB
最終ジャッジ日時 2023-10-14 22:15:40
合計ジャッジ時間 1,773 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 15 ms
7,940 KB
testcase_02 AC 15 ms
7,756 KB
testcase_03 AC 15 ms
7,904 KB
testcase_04 AC 15 ms
7,824 KB
testcase_05 AC 14 ms
7,856 KB
testcase_06 AC 15 ms
7,848 KB
testcase_07 WA -
testcase_08 AC 14 ms
7,844 KB
testcase_09 WA -
testcase_10 AC 15 ms
7,904 KB
testcase_11 AC 15 ms
7,828 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 15 ms
7,840 KB
testcase_16 AC 15 ms
7,776 KB
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

a, n = map(int,input().split())

sq = input()

ls = sq[n:]

c = 1
for N, i in enumerate(ls):
    if c > 0:
        if i == '(':
            c += 1
        else:
            c -= 1
    else:
        break

print(str(n + N))
0