結果
問題 |
No.22 括弧の対応
|
ユーザー |
![]() |
提出日時 | 2023-10-28 11:47:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 178 bytes |
コンパイル時間 | 309 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-25 16:17:14 |
合計ジャッジ時間 | 1,667 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 15 |
ソースコード
n,k=map(int,input().split()) x=str(input()) c=0 num=0 for i in range(n): if x[i]=='(': c+=1 else: c-=1 if i==k-1: num=c if i>k-1 and c==num-1: print(i+1)