結果

問題 No.1256 連続整数列
ユーザー tktk_snsntktk_snsn
提出日時 2021-09-22 23:01:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 7,988 KB
最終ジャッジ日時 2023-09-18 19:43:44
合計ジャッジ時間 3,731 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,736 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 16 ms
7,820 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 16 ms
7,812 KB
testcase_07 AC 16 ms
7,836 KB
testcase_08 AC 16 ms
7,756 KB
testcase_09 AC 16 ms
7,880 KB
testcase_10 AC 16 ms
7,820 KB
testcase_11 AC 16 ms
7,812 KB
testcase_12 AC 15 ms
7,820 KB
testcase_13 AC 17 ms
7,972 KB
testcase_14 AC 16 ms
7,808 KB
testcase_15 AC 16 ms
7,952 KB
testcase_16 AC 18 ms
7,876 KB
testcase_17 AC 16 ms
7,856 KB
testcase_18 AC 19 ms
7,776 KB
testcase_19 AC 16 ms
7,972 KB
testcase_20 AC 16 ms
7,984 KB
testcase_21 AC 17 ms
7,888 KB
testcase_22 AC 16 ms
7,860 KB
testcase_23 AC 16 ms
7,784 KB
testcase_24 AC 16 ms
7,800 KB
testcase_25 AC 15 ms
7,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def F(a, n):
    return (a + a + n - 1) * n // 2


A = int(input())
ans = "NO"
for n in range(3, A+1):
    if F(1, n) > A:
        break
    l = 0
    r = A
    while r - l > 1:
        m = (r + l) // 2
        if F(m, n) <= A:
            l = m
        else:
            r = m
    if F(l, n) == A:
        ans = "YES"
        break

print(ans)
0