結果
問題 | No.22 括弧の対応 |
ユーザー |
|
提出日時 | 2024-12-18 17:02:14 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 335 bytes |
コンパイル時間 | 248 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-18 17:02:16 |
合計ジャッジ時間 | 1,838 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 2 RE * 17 |
ソースコード
def main():n, k = [int(x) for x in input().split(" ")]s = list(input())l = []for i in range(len(s)):if i > k and len(l) == k:ans = ibreakif s[i] == "(":l.append(s[i])else:l.pop()print(ans)if __name__ == "__main__":main()