結果
| 問題 | No.2142 Segment Zero |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-03 17:18:18 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 44 ms / 2,000 ms |
| + 396µs | |
| コード長 | 232 bytes |
| 記録 | |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 64,788 KB |
| 実行使用メモリ | 58,172 KB |
| 最終ジャッジ日時 | 2026-10-16 16:21:13 |
| 合計ジャッジ時間 | 4,145 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 36 |
ソースコード
n,k=map(int,input().split())
s=n*(n+1)//2
r=1
c=0
for l in range(1,n+1):
while r<=n and c+r<=s-k:
c+=r
r+=1
if c==s-k:
print(1)
exit(0)
if r==l:
c+=r
r+=1
c-=l
print(2)