結果
| 問題 | No.2177 Recurring ab | 
| コンテスト | |
| ユーザー |  とりゐ | 
| 提出日時 | 2023-01-06 21:52:09 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 48 ms / 2,000 ms | 
| コード長 | 313 bytes | 
| コンパイル時間 | 403 ms | 
| コンパイル使用メモリ | 82,304 KB | 
| 実行使用メモリ | 59,392 KB | 
| 最終ジャッジ日時 | 2024-11-30 17:50:11 | 
| 合計ジャッジ時間 | 2,009 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
n=int(input())
'''
x=(a*p+b)/(p*p-1)
'''
ans=0
for a in range(10):
  for b in range(10):
    if a==b:
      continue
    m=max(a+1,b+1,2)
    ng,ok=10**9+1,m-1
    while abs(ng-ok)>1:
      p=(ng+ok)//2
      if n*(a*p+b)>p*p-1:
        ok=p
      else:
        ng=p
    #print(a,b,p-m)
    ans+=ok-m+1
print(ans)
            
            
            
        