結果

問題 No.2177 Recurring ab
ユーザー katonyonkokatonyonko
提出日時 2023-01-06 21:43:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 1,914 ms
コンパイル使用メモリ 86,356 KB
実行使用メモリ 75,924 KB
最終ジャッジ日時 2023-08-20 14:47:01
合計ジャッジ時間 3,863 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
75,604 KB
testcase_01 AC 64 ms
75,792 KB
testcase_02 AC 73 ms
75,840 KB
testcase_03 AC 68 ms
75,576 KB
testcase_04 AC 69 ms
75,628 KB
testcase_05 AC 69 ms
75,540 KB
testcase_06 AC 72 ms
75,812 KB
testcase_07 AC 68 ms
75,740 KB
testcase_08 AC 69 ms
75,732 KB
testcase_09 AC 68 ms
75,832 KB
testcase_10 AC 68 ms
75,584 KB
testcase_11 AC 70 ms
75,868 KB
testcase_12 AC 67 ms
75,644 KB
testcase_13 AC 67 ms
75,704 KB
testcase_14 AC 66 ms
75,704 KB
testcase_15 AC 66 ms
75,924 KB
testcase_16 AC 67 ms
75,776 KB
testcase_17 AC 68 ms
75,632 KB
testcase_18 AC 66 ms
75,752 KB
testcase_19 AC 65 ms
75,836 KB
testcase_20 AC 65 ms
75,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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