Solve ABC165 A, B, D in Python

Introduction

C is difficult. A is also difficult

A problem

Problem

** Thoughts ** When I tried to enjoy it, I did WA, so I made a steady for.

k = int(input())
a, b = map(int,input().split())

for i in range(a,b+1):
    if i % k == 0:
        print('OK')
        quit()

print('NG')

B problem

Problem

** Thoughts ** Just while

x = int(input())

seed = 100
ans = 0
while True:
    seed = int(1.01 * seed)
    ans += 1
    if seed >= x:
        print(ans)
        break

C problem

Problem

** Thoughts ** I thought I'd do a full search, but the implementation seems to be heavy, so I gave up and went to D

D problem

Problem

** Thoughts ** If $ x <b $, the subtraction term at the end becomes 0 when the floor is taken, so $ x <b $. Intuitively, the larger the number, the larger it will be when you take the floor, so take the maximum $ x $ that meets the conditions.

import math
a, b, n = map(int,input().split())

n = min(b,n) #search range
if n == b:
    n -= 1
ans = math.floor(a/b*n)
print(ans)

Summary

What is C? I will do my best tomorrow. see you. good night.

Recommended Posts

Solve ABC165 A, B, D in Python
Solve ABC175 A, B, C in Python
Solve ABC175 D in Python
Solve ABC166 A ~ D with Python
Solve ABC036 A ~ C in Python
Solve ABC037 A ~ C in Python
Solve Atcoder ABC176 (A, B, C, E) in Python
Solve ABC169 in Python
ABC 157 D --Solve Friend Suggestions in Python!
Solve ABC176 E in Python
AtCoder ABC 182 Python (A ~ D)
Solve ABC163 A ~ C with Python
ABC127 A, B, C Explanation (python)
ABC166 in Python A ~ C problem
Solve Atcoder ABC169 A-D in Python
Solve ABC168 A ~ C with Python
Solve ABC162 A ~ C with Python
Solve ABC167 A ~ C with Python
ABC128 A, B, C commentary (python)
Solve ABC158 A ~ C with Python
ABC126 A, B, C Explanation (python)
[AtCoder] Solve ABC1 ~ 100 A problem with Python
I wanted to solve ABC159 in Python
I wanted to solve the ABC164 A ~ D problem with Python
Solve ABC168D in Python
Solve ABC167-D in Python
Solve ABC146-C in Python
Solve ABC098-C in Python
Solve ABC159-D in Python
Python3> round (a --b, 7)
Solve ABC160-E in Python
[AtCoder] Solve A problem of ABC101 ~ 169 with Python
AtCoder ABC 177 Python (A ~ E)
Solve AtCoder ABC166 with python
Create a function in Python
Create a dictionary in Python
[AtCoder explanation] Control the A, B, (C), D problems of ABC165 with Python!
Solve multiplication (equivalent to paiza rank D) in Python
[AtCoder explanation] Control the A, B, C, D problems of ABC183 with Python!
ABC129 A, B, C commentary
Until drawing a 3D graph in Python on windows10
AtCoder ABC 176 Python (A ~ E)
Make a bookmarklet in Python
Atcoder ABC165 A-D in Python
Atcoder ABC166 A-E in Python
Solve optimization problems in Python
Draw a heart in Python
[AtCoder explanation] Control the A, B, C, D problems of ABC181 with Python!
Solve AtCoder ABC 186 with Python
Atcoder ABC169 A-E in Python
AtCoder ABC177 A-D in python
Solve number sorting (equivalent to paiza rank D) in Python
[AtCoder explanation] Control ABC180 A, B, C problems with Python!
Solve with Ruby and Python AtCoder ABC133 D Cumulative sum
[AtCoder explanation] Control ABC158 A, B, C problems with Python!
Create code that outputs "A and pretending B" in python
Solve character matches (equivalent to paiza rank D) in Python
AtCoder ABC151 Problem D Speed comparison in C ++ / Python / PyPy
AtCoder ABC168 A case expression solved in Ruby and Python
[AtCoder explanation] Control ABC164 A, B, C problems with Python!
[AtCoder explanation] Control ABC168 A, B, C problems with Python!