結果

問題 No.2142 Segment Zero
ユーザー roarisroaris
提出日時 2022-12-02 22:16:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 359 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 226,688 KB
最終ジャッジ日時 2024-04-18 06:34:21
合計ジャッジ時間 8,328 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
53,760 KB
testcase_01 AC 333 ms
226,432 KB
testcase_02 AC 47 ms
53,888 KB
testcase_03 AC 46 ms
53,376 KB
testcase_04 AC 359 ms
226,304 KB
testcase_05 AC 330 ms
226,304 KB
testcase_06 AC 47 ms
53,632 KB
testcase_07 AC 113 ms
104,448 KB
testcase_08 AC 329 ms
226,304 KB
testcase_09 AC 208 ms
161,536 KB
testcase_10 AC 328 ms
226,048 KB
testcase_11 AC 324 ms
226,304 KB
testcase_12 AC 320 ms
226,688 KB
testcase_13 AC 329 ms
226,176 KB
testcase_14 AC 328 ms
226,176 KB
testcase_15 AC 326 ms
226,176 KB
testcase_16 AC 320 ms
226,048 KB
testcase_17 AC 273 ms
194,816 KB
testcase_18 AC 58 ms
64,384 KB
testcase_19 AC 76 ms
81,536 KB
testcase_20 AC 185 ms
150,784 KB
testcase_21 AC 153 ms
132,736 KB
testcase_22 AC 250 ms
181,760 KB
testcase_23 AC 88 ms
91,776 KB
testcase_24 AC 116 ms
109,568 KB
testcase_25 AC 88 ms
91,520 KB
testcase_26 AC 168 ms
142,080 KB
testcase_27 AC 109 ms
104,320 KB
testcase_28 AC 156 ms
133,760 KB
testcase_29 AC 182 ms
150,656 KB
testcase_30 AC 254 ms
181,504 KB
testcase_31 AC 58 ms
64,256 KB
testcase_32 AC 104 ms
99,840 KB
testcase_33 AC 74 ms
78,848 KB
testcase_34 AC 103 ms
99,712 KB
testcase_35 AC 321 ms
225,792 KB
testcase_36 AC 95 ms
95,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N, K = map(int, input().split())
s = {0}
acc = 0

for i in range(1, N+1):
    acc += i
    
    if acc-(N*(N+1)//2-K) in s:
        exit(print(1))
    
    s.add(acc)

print(2)
0