結果

問題 No.2142 Segment Zero
ユーザー 👑 H20H20
提出日時 2022-12-02 21:55:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 212 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,360 KB
実行使用メモリ 246,760 KB
最終ジャッジ日時 2024-04-18 05:49:55
合計ジャッジ時間 11,137 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 462 ms
243,060 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 328 ms
242,944 KB
testcase_08 WA -
testcase_09 AC 320 ms
243,196 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 111 ms
129,792 KB
testcase_19 AC 109 ms
123,392 KB
testcase_20 WA -
testcase_21 AC 243 ms
242,560 KB
testcase_22 WA -
testcase_23 AC 104 ms
123,504 KB
testcase_24 AC 131 ms
158,080 KB
testcase_25 AC 156 ms
190,208 KB
testcase_26 AC 251 ms
243,072 KB
testcase_27 AC 263 ms
242,816 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 236 ms
242,560 KB
testcase_32 AC 135 ms
148,224 KB
testcase_33 AC 81 ms
100,480 KB
testcase_34 AC 160 ms
191,232 KB
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int, input().split())
all = N*(N+1)//2
U = set()
D = set()
for i in range(1,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(3)

0