結果

問題 No.2142 Segment Zero
ユーザー nikoro_is_wolfnikoro_is_wolf
提出日時 2022-12-03 14:06:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 58,624 KB
最終ジャッジ日時 2024-04-18 23:05:47
合計ジャッジ時間 3,416 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,096 KB
testcase_01 AC 64 ms
58,368 KB
testcase_02 AC 38 ms
51,712 KB
testcase_03 AC 46 ms
57,344 KB
testcase_04 AC 49 ms
57,856 KB
testcase_05 AC 48 ms
58,240 KB
testcase_06 AC 40 ms
51,712 KB
testcase_07 AC 45 ms
58,240 KB
testcase_08 AC 63 ms
57,984 KB
testcase_09 AC 52 ms
57,856 KB
testcase_10 AC 65 ms
57,984 KB
testcase_11 AC 66 ms
58,112 KB
testcase_12 AC 61 ms
57,992 KB
testcase_13 AC 63 ms
57,984 KB
testcase_14 AC 62 ms
57,984 KB
testcase_15 AC 66 ms
58,368 KB
testcase_16 AC 61 ms
57,856 KB
testcase_17 AC 62 ms
58,624 KB
testcase_18 AC 45 ms
58,112 KB
testcase_19 AC 45 ms
57,984 KB
testcase_20 AC 54 ms
57,788 KB
testcase_21 AC 48 ms
58,112 KB
testcase_22 AC 60 ms
58,368 KB
testcase_23 AC 50 ms
58,112 KB
testcase_24 AC 51 ms
58,240 KB
testcase_25 AC 43 ms
57,984 KB
testcase_26 AC 49 ms
57,984 KB
testcase_27 AC 49 ms
58,368 KB
testcase_28 AC 53 ms
58,368 KB
testcase_29 AC 54 ms
58,112 KB
testcase_30 AC 57 ms
57,856 KB
testcase_31 AC 47 ms
58,368 KB
testcase_32 AC 55 ms
58,368 KB
testcase_33 AC 49 ms
58,112 KB
testcase_34 AC 48 ms
57,788 KB
testcase_35 AC 64 ms
58,368 KB
testcase_36 AC 50 ms
57,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
ans=2
Sum,Max=0,0
for i in range(1,N+1):
    Max+=i
d=Max-K
for i in range(1,N+1):
    Sum+=i
    if Sum==d:
        ans=1
        break
    if Sum>d:
        break
    if (d-Sum)%i==0 and (d-Sum)//i+i<=N:
        ans=1
        break
print(ans)
0