結果
問題 | No.1748 Parking Lot |
ユーザー |
![]() |
提出日時 | 2024-04-11 15:46:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 311 bytes |
コンパイル時間 | 401 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-02 21:37:58 |
合計ジャッジ時間 | 1,994 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
N,K=map(int,input().split()) K-=1 if N==1: ans=K elif N==2: if K==0: ans=1 else: ans=0 else: if K==N-1: l,r=1,N-1 else: l,r=K+1,N-1 while r-l>=2: m=(l+r-1)//2 if m+1<r: l=m+1 else: r=m ans=l print(ans+1)