結果
| 問題 | No.2177 Recurring ab |
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2023-01-06 21:52:09 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 313 bytes |
| 記録 | |
| コンパイル時間 | 164 ms |
| コンパイル使用メモリ | 85,284 KB |
| 実行使用メモリ | 60,680 KB |
| 最終ジャッジ日時 | 2026-05-24 08:37:39 |
| 合計ジャッジ時間 | 1,934 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
とりゐ