結果

問題 No.2142 Segment Zero
ユーザー 遭難者
提出日時 2022-11-16 12:11:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 177 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 82,144 KB
実行使用メモリ 61,316 KB
最終ジャッジ日時 2024-09-17 09:11:46
合計ジャッジ時間 2,811 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
s=2
for i in range(1,n+1):
    x=(n-i)*(n+i+1)//2-k
    if x<0:
        break
    if x>i*(n-i):
        continue
    if x%i==0:
        s=1
print(s)
0