結果

問題 No.413 +5,000,000pts
ユーザー yuppe19 😺yuppe19 😺
提出日時 2016-06-06 16:30:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 848 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-20 07:13:56
合計ジャッジ時間 2,247 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 848 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python3
from decimal import Decimal
from itertools import count

def calc(d):
    return int((-1 + (1+4*d)**.5) / 2)

def correct(d):
    return int((-1 + (1+4*Decimal(str(d))).sqrt()) / 2)

cnt = 0
for k in count(912345678):
    d = k*k + k - 1
    if not 1 <= d <= 10**18:
        continue
    if calc(d) != correct(d):
        print(d)
        cnt += 1
        if cnt == 100000:
            break
0