結果

問題 No.2177 Recurring ab
ユーザー HydruHydru
提出日時 2023-01-06 22:12:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 475 bytes
コンパイル時間 2,253 ms
コンパイル使用メモリ 86,432 KB
実行使用メモリ 76,360 KB
最終ジャッジ日時 2023-08-20 15:22:04
合計ジャッジ時間 3,379 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
75,948 KB
testcase_01 AC 62 ms
76,068 KB
testcase_02 AC 62 ms
76,288 KB
testcase_03 AC 63 ms
75,844 KB
testcase_04 AC 67 ms
76,196 KB
testcase_05 AC 71 ms
76,232 KB
testcase_06 AC 65 ms
76,188 KB
testcase_07 AC 63 ms
76,144 KB
testcase_08 AC 65 ms
76,284 KB
testcase_09 AC 67 ms
76,344 KB
testcase_10 AC 67 ms
76,208 KB
testcase_11 AC 65 ms
75,944 KB
testcase_12 AC 64 ms
76,188 KB
testcase_13 AC 62 ms
76,072 KB
testcase_14 AC 65 ms
76,216 KB
testcase_15 AC 65 ms
76,336 KB
testcase_16 AC 65 ms
76,216 KB
testcase_17 AC 63 ms
75,980 KB
testcase_18 AC 64 ms
76,312 KB
testcase_19 AC 64 ms
76,360 KB
testcase_20 AC 65 ms
76,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())

def comparison_bunsuu(a,b,c,d):
    A=b*c
    B=a*d
    if A>B:
        return True
    else:
        return False

ans=0

for a in range(10):
    for b in range(10):
        if a==b:
            continue
        l=max(a,b)
        r=10**9+1
        while(r-l>1):
            p=(r+l)//2
            X=(a*p+b,p**2-1)
            if(comparison_bunsuu(X[1],X[0],n,1)):
                l=p
            else:
                r=p
        ans+=l-max(a,b)

print(ans)
0