結果

問題 No.2142 Segment Zero
ユーザー 遭難者遭難者
提出日時 2022-10-26 21:59:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 232 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 75,988 KB
最終ジャッジ日時 2023-09-17 15:11:01
合計ジャッジ時間 5,462 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,116 KB
testcase_01 AC 91 ms
75,772 KB
testcase_02 WA -
testcase_03 AC 77 ms
71,004 KB
testcase_04 AC 85 ms
75,744 KB
testcase_05 AC 85 ms
75,848 KB
testcase_06 AC 77 ms
71,468 KB
testcase_07 AC 82 ms
75,572 KB
testcase_08 AC 87 ms
75,728 KB
testcase_09 AC 82 ms
75,740 KB
testcase_10 AC 87 ms
75,876 KB
testcase_11 AC 89 ms
75,856 KB
testcase_12 AC 87 ms
75,864 KB
testcase_13 AC 87 ms
75,924 KB
testcase_14 AC 86 ms
75,700 KB
testcase_15 AC 88 ms
75,868 KB
testcase_16 AC 88 ms
75,840 KB
testcase_17 AC 84 ms
75,744 KB
testcase_18 AC 80 ms
75,852 KB
testcase_19 AC 80 ms
75,884 KB
testcase_20 AC 85 ms
75,848 KB
testcase_21 AC 85 ms
75,884 KB
testcase_22 AC 86 ms
75,988 KB
testcase_23 AC 82 ms
75,624 KB
testcase_24 AC 83 ms
75,888 KB
testcase_25 AC 82 ms
75,840 KB
testcase_26 AC 82 ms
75,748 KB
testcase_27 AC 79 ms
75,692 KB
testcase_28 AC 82 ms
75,572 KB
testcase_29 AC 83 ms
75,676 KB
testcase_30 AC 83 ms
75,872 KB
testcase_31 AC 76 ms
75,928 KB
testcase_32 AC 81 ms
75,672 KB
testcase_33 AC 79 ms
75,836 KB
testcase_34 AC 81 ms
75,840 KB
testcase_35 AC 84 ms
75,680 KB
testcase_36 AC 80 ms
75,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k = map(int, input().split())
for i in range(1, n):
    kk = (n * (n + 1) - i * (i + 1)) // 2 - k
    if kk < 0:
        break
    if kk > i * (n - i):
        continue
    if kk % i == 0:
        print(1)
        exit()
print(2)
0