結果

問題 No.2142 Segment Zero
ユーザー ああいいああいい
提出日時 2022-12-04 15:53:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 194 ms / 2,000 ms
コード長 218 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 224,512 KB
最終ジャッジ日時 2024-04-19 23:59:51
合計ジャッジ時間 5,723 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
51,200 KB
testcase_01 AC 192 ms
224,128 KB
testcase_02 AC 33 ms
51,840 KB
testcase_03 AC 33 ms
51,584 KB
testcase_04 AC 194 ms
224,512 KB
testcase_05 AC 191 ms
224,384 KB
testcase_06 AC 33 ms
51,456 KB
testcase_07 AC 78 ms
102,016 KB
testcase_08 AC 182 ms
224,000 KB
testcase_09 AC 125 ms
159,104 KB
testcase_10 AC 187 ms
224,384 KB
testcase_11 AC 189 ms
223,872 KB
testcase_12 AC 189 ms
224,384 KB
testcase_13 AC 193 ms
224,256 KB
testcase_14 AC 188 ms
224,256 KB
testcase_15 AC 182 ms
224,256 KB
testcase_16 AC 193 ms
224,256 KB
testcase_17 AC 165 ms
193,024 KB
testcase_18 AC 42 ms
62,592 KB
testcase_19 AC 56 ms
79,488 KB
testcase_20 AC 114 ms
148,736 KB
testcase_21 AC 100 ms
130,560 KB
testcase_22 AC 148 ms
179,712 KB
testcase_23 AC 66 ms
89,472 KB
testcase_24 AC 82 ms
107,392 KB
testcase_25 AC 67 ms
89,600 KB
testcase_26 AC 111 ms
139,520 KB
testcase_27 AC 80 ms
102,144 KB
testcase_28 AC 105 ms
131,072 KB
testcase_29 AC 117 ms
148,224 KB
testcase_30 AC 146 ms
179,584 KB
testcase_31 AC 38 ms
61,824 KB
testcase_32 AC 73 ms
97,408 KB
testcase_33 AC 54 ms
77,184 KB
testcase_34 AC 74 ms
97,408 KB
testcase_35 AC 186 ms
223,744 KB
testcase_36 AC 74 ms
93,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
import sys

S = N * (N + 1) // 2
L = S - K
s = set()
now = 0
s.add(now)
for i in range(1,N + 1):
    now += i
    if now - L in s:
        print(1)
        exit()
    s.add(now)
print(2)
0