結果
問題 |
No.2142 Segment Zero
|
ユーザー |
![]() |
提出日時 | 2024-11-25 14:38:31 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 95 ms / 2,000 ms |
コード長 | 200 bytes |
コンパイル時間 | 199 ms |
コンパイル使用メモリ | 82,580 KB |
実行使用メモリ | 61,268 KB |
最終ジャッジ日時 | 2024-11-25 14:38:39 |
合計ジャッジ時間 | 3,154 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 35 |
ソースコード
n,K=map(int,input().split()) K=(n*(n+1))//2-K s=1 r=1 for l in range(1,n+1): while r+1<=n and s<K: r+=1 s+=r if s==K: print(1) exit() s-=l if l==r: r=l+1 s=l+1 print(2)