提出 #31070161


ソースコード 拡げる

a, b, x = map(int, input().split())
def cost(n):
    n2 = n
    d = 0
    while n2 > 0:
        n2 //= 10
        d += 1
    return a * n + b * d
ok = 0
ng = 10 ** 9 + 1
while ng - ok > 1:
    m = (ok + ng) // 2
    if cost(m) <= x:
        ok = m
    else:
        ng = m
print(ok)

提出情報

提出日時
問題 C - Buy an Integer
ユーザ Pro_ktmr
言語 PyPy3 (7.3.0)
得点 300
コード長 298 Byte
結果 AC
実行時間 61 ms
メモリ 61956 KiB

ジャッジ結果

セット名 sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 4
AC × 16
セット名 テストケース
sample sample01, sample02, sample03, sample04
All border01, border02, border03, corner01, max01, max02, max03, min01, min02, rnd01, rnd02, rnd03, sample01, sample02, sample03, sample04
ケース名 結果 実行時間 メモリ
border01 AC 61 ms 61920 KiB
border02 AC 49 ms 61892 KiB
border03 AC 48 ms 61940 KiB
corner01 AC 51 ms 61772 KiB
max01 AC 48 ms 61796 KiB
max02 AC 47 ms 61808 KiB
max03 AC 43 ms 61952 KiB
min01 AC 47 ms 61708 KiB
min02 AC 50 ms 61940 KiB
rnd01 AC 49 ms 61880 KiB
rnd02 AC 48 ms 61876 KiB
rnd03 AC 48 ms 61956 KiB
sample01 AC 51 ms 61916 KiB
sample02 AC 50 ms 61640 KiB
sample03 AC 49 ms 61908 KiB
sample04 AC 49 ms 61636 KiB