結果

問題 No.2142 Segment Zero
ユーザー tassei903tassei903
提出日時 2022-12-02 22:03:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 571 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 82,508 KB
実行使用メモリ 83,892 KB
最終ジャッジ日時 2024-04-18 06:05:39
合計ジャッジ時間 6,527 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,224 KB
testcase_01 AC 180 ms
83,272 KB
testcase_02 AC 38 ms
52,096 KB
testcase_03 AC 47 ms
65,536 KB
testcase_04 AC 325 ms
83,840 KB
testcase_05 AC 323 ms
83,804 KB
testcase_06 AC 38 ms
52,352 KB
testcase_07 AC 99 ms
83,456 KB
testcase_08 AC 178 ms
83,308 KB
testcase_09 AC 132 ms
83,328 KB
testcase_10 AC 177 ms
83,448 KB
testcase_11 AC 179 ms
83,404 KB
testcase_12 AC 178 ms
83,284 KB
testcase_13 AC 184 ms
83,456 KB
testcase_14 AC 180 ms
83,892 KB
testcase_15 AC 178 ms
83,620 KB
testcase_16 AC 173 ms
83,688 KB
testcase_17 AC 159 ms
82,560 KB
testcase_18 AC 58 ms
77,312 KB
testcase_19 AC 79 ms
77,568 KB
testcase_20 AC 122 ms
79,780 KB
testcase_21 AC 136 ms
80,648 KB
testcase_22 AC 139 ms
81,152 KB
testcase_23 AC 76 ms
77,072 KB
testcase_24 AC 93 ms
77,864 KB
testcase_25 AC 82 ms
78,976 KB
testcase_26 AC 125 ms
81,092 KB
testcase_27 AC 100 ms
81,664 KB
testcase_28 AC 112 ms
79,232 KB
testcase_29 AC 125 ms
80,000 KB
testcase_30 AC 143 ms
81,504 KB
testcase_31 AC 61 ms
80,896 KB
testcase_32 AC 95 ms
77,924 KB
testcase_33 AC 67 ms
76,532 KB
testcase_34 AC 90 ms
78,848 KB
testcase_35 AC 177 ms
83,252 KB
testcase_36 AC 91 ms
77,276 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