結果

問題 No.2177 Recurring ab
ユーザー flippergo
提出日時 2024-10-29 09:15:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 60,556 KB
最終ジャッジ日時 2024-10-29 09:15:50
合計ジャッジ時間 2,388 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = 0
for a in range(10):
    for b in range(10):
        if a==b:continue
        high = a*N+N*b+1
        low = 0
        while high-low>1:
            mid = (high+low)//2
            if N*(mid*a+b)>mid**2-1:
                low = mid
            else:
                high = mid
        pmax = low
        if pmax>=max(a+1,b+1,2):
            ans += pmax-max(a+1,b+1,2)+1
print(ans)
0