結果

問題 No.2142 Segment Zero
ユーザー ニックネームニックネーム
提出日時 2022-12-02 22:10:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 207 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-18 06:18:59
合計ジャッジ時間 15,139 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,624 KB
testcase_01 AC 527 ms
10,624 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 626 ms
10,752 KB
testcase_04 AC 604 ms
10,752 KB
testcase_05 AC 604 ms
10,880 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 WA -
testcase_08 AC 535 ms
10,752 KB
testcase_09 WA -
testcase_10 AC 535 ms
10,752 KB
testcase_11 AC 542 ms
10,624 KB
testcase_12 AC 528 ms
10,752 KB
testcase_13 AC 536 ms
10,752 KB
testcase_14 AC 563 ms
10,752 KB
testcase_15 AC 530 ms
10,752 KB
testcase_16 AC 533 ms
10,752 KB
testcase_17 AC 448 ms
10,752 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 308 ms
10,752 KB
testcase_21 WA -
testcase_22 AC 389 ms
10,624 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 263 ms
10,752 KB
testcase_29 AC 306 ms
10,752 KB
testcase_30 AC 387 ms
10,752 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 517 ms
10,752 KB
testcase_36 AC 142 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
for i in range(n):
    if k == (i+1)*(i+2)//2: print(1); exit()
ans = 0; i = n+1
for v in range(n, 0, -1):
    if k >= v: k -= v; i = v
    elif i == v+1: ans += 1
print(ans)
0