結果

問題 No.2142 Segment Zero
ユーザー tassei903tassei903
提出日時 2022-12-02 22:03:50
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 349 ms / 2,000 ms
コード長 571 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 84,856 KB
最終ジャッジ日時 2023-07-31 05:11:33
合計ジャッジ時間 7,973 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,472 KB
testcase_01 AC 205 ms
84,640 KB
testcase_02 AC 73 ms
71,452 KB
testcase_03 AC 82 ms
83,224 KB
testcase_04 AC 349 ms
84,760 KB
testcase_05 AC 349 ms
84,856 KB
testcase_06 AC 72 ms
71,464 KB
testcase_07 AC 131 ms
84,472 KB
testcase_08 AC 212 ms
84,696 KB
testcase_09 AC 167 ms
84,768 KB
testcase_10 AC 210 ms
84,820 KB
testcase_11 AC 208 ms
84,816 KB
testcase_12 AC 206 ms
84,744 KB
testcase_13 AC 210 ms
84,740 KB
testcase_14 AC 208 ms
84,448 KB
testcase_15 AC 205 ms
84,596 KB
testcase_16 AC 208 ms
84,448 KB
testcase_17 AC 188 ms
83,412 KB
testcase_18 AC 89 ms
78,348 KB
testcase_19 AC 110 ms
78,468 KB
testcase_20 AC 153 ms
81,044 KB
testcase_21 AC 169 ms
81,948 KB
testcase_22 AC 173 ms
82,348 KB
testcase_23 AC 107 ms
78,240 KB
testcase_24 AC 126 ms
79,300 KB
testcase_25 AC 116 ms
79,944 KB
testcase_26 AC 156 ms
82,464 KB
testcase_27 AC 139 ms
82,784 KB
testcase_28 AC 149 ms
80,604 KB
testcase_29 AC 156 ms
81,224 KB
testcase_30 AC 175 ms
82,568 KB
testcase_31 AC 92 ms
82,168 KB
testcase_32 AC 125 ms
79,164 KB
testcase_33 AC 99 ms
77,688 KB
testcase_34 AC 124 ms
80,116 KB
testcase_35 AC 201 ms
84,344 KB
testcase_36 AC 118 ms
78,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

n, k = na()
k = n * (n+1)//2-k

f = [i*(i+1)//2 for i in range(n+1)]
from bisect import bisect_left as bl
for i in range(n+1):
    j = bl(f, f[i] - k)
    if f[i] - k == f[j]:
        print(1)
        exit()
print(2)
0