結果

問題 No.2142 Segment Zero
ユーザー rlangevinrlangevin
提出日時 2023-04-14 12:21:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 424 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 243,716 KB
最終ジャッジ日時 2024-04-18 11:36:16
合計ジャッジ時間 10,498 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,840 KB
testcase_01 AC 342 ms
243,076 KB
testcase_02 AC 38 ms
52,352 KB
testcase_03 AC 307 ms
243,332 KB
testcase_04 AC 424 ms
243,332 KB
testcase_05 AC 401 ms
242,816 KB
testcase_06 AC 34 ms
52,224 KB
testcase_07 AC 323 ms
243,452 KB
testcase_08 AC 373 ms
243,076 KB
testcase_09 AC 314 ms
243,288 KB
testcase_10 AC 389 ms
243,716 KB
testcase_11 AC 377 ms
243,204 KB
testcase_12 AC 389 ms
243,456 KB
testcase_13 AC 375 ms
243,264 KB
testcase_14 AC 386 ms
243,328 KB
testcase_15 AC 386 ms
243,336 KB
testcase_16 AC 384 ms
243,332 KB
testcase_17 AC 313 ms
243,072 KB
testcase_18 AC 97 ms
130,432 KB
testcase_19 AC 95 ms
123,648 KB
testcase_20 AC 215 ms
241,280 KB
testcase_21 AC 218 ms
243,072 KB
testcase_22 AC 295 ms
243,200 KB
testcase_23 AC 99 ms
123,648 KB
testcase_24 AC 114 ms
159,104 KB
testcase_25 AC 143 ms
190,976 KB
testcase_26 AC 249 ms
242,816 KB
testcase_27 AC 242 ms
243,072 KB
testcase_28 AC 176 ms
206,848 KB
testcase_29 AC 204 ms
240,768 KB
testcase_30 AC 259 ms
243,328 KB
testcase_31 AC 229 ms
242,944 KB
testcase_32 AC 126 ms
148,224 KB
testcase_33 AC 74 ms
100,992 KB
testcase_34 AC 141 ms
191,104 KB
testcase_35 AC 364 ms
242,944 KB
testcase_36 AC 102 ms
130,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
S, SS = set(), set()
for i in range(N + 1):
    S.add(i * (i + 1)//2)
    SS.add(N * (N + 1)//2 - i * (i + 1)//2)

for s in S:
    if K - s in SS:
        print(1)
        exit()
print(2)
0