結果

問題 No.2142 Segment Zero
ユーザー 👑 H20H20
提出日時 2022-12-02 21:56:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 446 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 243,336 KB
最終ジャッジ日時 2024-04-18 05:50:56
合計ジャッジ時間 11,214 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 334 ms
243,320 KB
testcase_02 AC 37 ms
52,096 KB
testcase_03 AC 341 ms
242,972 KB
testcase_04 AC 446 ms
243,336 KB
testcase_05 AC 415 ms
242,688 KB
testcase_06 AC 36 ms
51,712 KB
testcase_07 AC 324 ms
243,336 KB
testcase_08 AC 424 ms
243,188 KB
testcase_09 AC 321 ms
243,316 KB
testcase_10 AC 425 ms
243,052 KB
testcase_11 AC 424 ms
243,196 KB
testcase_12 AC 422 ms
243,316 KB
testcase_13 AC 422 ms
242,800 KB
testcase_14 AC 445 ms
243,320 KB
testcase_15 AC 428 ms
243,092 KB
testcase_16 AC 419 ms
242,804 KB
testcase_17 AC 358 ms
243,072 KB
testcase_18 AC 107 ms
130,304 KB
testcase_19 AC 106 ms
123,904 KB
testcase_20 AC 243 ms
241,024 KB
testcase_21 AC 245 ms
243,072 KB
testcase_22 AC 316 ms
243,072 KB
testcase_23 AC 102 ms
123,392 KB
testcase_24 AC 131 ms
158,976 KB
testcase_25 AC 157 ms
190,848 KB
testcase_26 AC 257 ms
242,816 KB
testcase_27 AC 274 ms
243,072 KB
testcase_28 AC 201 ms
206,720 KB
testcase_29 AC 231 ms
240,640 KB
testcase_30 AC 298 ms
243,072 KB
testcase_31 AC 236 ms
243,072 KB
testcase_32 AC 131 ms
148,096 KB
testcase_33 AC 77 ms
100,864 KB
testcase_34 AC 159 ms
191,104 KB
testcase_35 AC 428 ms
243,076 KB
testcase_36 AC 122 ms
130,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int, input().split())
all = N*(N+1)//2
U = set()
D = set()
for i in range(N+1):
    v = i*(i+1)//2
    U.add(v)
    D.add(all-v)
for u in U:
    if K-u in D:
        print(1)
        exit()
print(2)

0