ABC127 A, B, C Explanation (python)

A problem

https://atcoder.jp/contests/abc127/tasks/abc127_a

a,b = map(int,input().split())
if 13 <= a:
    print(b)
elif 6 <= a <= 12:
    print(b//2)
else:
    print(0)

Determine the age zone with the if statement and output the amount.

B problem

https://atcoder.jp/contests/abc127/tasks/abc127_b

r,d,x = map(int,input().split())
for i in range(10):
    print(r*x-d)
    x = r*x-d

Recurrence formula (applying the previous calculation result to the next calculation result) problem

C problem

https://atcoder.jp/contests/abc127/tasks/abc127_c

n,m = map(int,input().split())
l = [0]*m
r = [0]*m
for i in range(m):
    l[i],r[i] = map(int,input().split())
if min(r)-max(l) < 0:
    print(0)
else:
    print(min(r)-max(l)+1)

By saying that the sections overlap in all The key between the largest l and the smallest r is applicable.

Recommended Posts

ABC127 A, B, C Explanation (python)
ABC126 A, B, C Explanation (python)
ABC128 A, B, C commentary (python)
[AtCoder explanation] Control ABC180 A, B, C problems with Python!
[AtCoder explanation] Control ABC188 A, B, C problems with Python!
[AtCoder explanation] Control ABC158 A, B, C problems with Python!
[AtCoder explanation] Control ABC164 A, B, C problems with Python!
[AtCoder explanation] Control ABC168 A, B, C problems with Python!
ABC129 A, B, C commentary
Solve ABC163 A ~ C with Python
[AtCoder explanation] Control the A, B, C problems of ABC182 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC186 with Python!
ABC166 in Python A ~ C problem
[AtCoder explanation] Control the A, B, C problems of ABC185 with Python!
Solve ABC168 A ~ C with Python
Solve ABC036 A ~ C in Python
Solve ABC162 A ~ C with Python
Solve ABC167 A ~ C with Python
Solve ABC158 A ~ C with Python
Solve Atcoder ABC176 (A, B, C, E) in Python
[AtCoder explanation] Control the A, B, C problems of ABC187 with Python!
Solve ABC037 A ~ C in Python
[AtCoder explanation] Control the A, B, C problems of ABC184 with Python!
[AtCoder explanation] Control the A, B, (C), D problems of ABC165 with Python!
[AtCoder explanation] Control the A, B, C, D problems of ABC183 with Python!
[AtCoder explanation] Control the A, B, C, D problems of ABC181 with Python!
python> keyword arguments> hoge (** {'a': 1,'b': 2,'c': 3})
Solve ABC165 A, B, D in Python
ABC147 C --HonestOrUnkind2 [Python]
Python3> round (a --b, 7)
Challenge AtCoder (ABC) 164 with Python! A ~ C problem
AtCoder ABC 177 Python (A ~ E)
ABC163 C problem with python3
AtCoder ABC 178 Python (A ~ E)
ABC memorandum [ABC163 C --managementr] (Python)
AtCoder ABC 176 Python (A ~ E)
AtCoder ABC 182 Python (A ~ D)
ABC188 C problem with python3
ABC187 C problem with python
AtCoder Beginner Contest 166 A Explanation of Problem "A? C" (Python3, C ++, Java)
Python a + = b and a = a + b are different
AtCoder Beginner Contest 174 B Problem "Distance" Explanation (C ++, Python, Java)
ABC memorandum [ABC159 C --Maximum Volume] (Python)
AtCoder Beginner Contest 177 B Problem "Substring" Explanation (Python3, C ++, Java)
Solve ABC166 A ~ D with Python
AtCoder Beginner Contest 167 A Problem "Registration" Explanation (Python3, C ++, Java)
ABC memorandum [ABC161 C --Replacing Integer] (Python)
ABC memorandum [ABC158 C --Tax Increase] (Python)
Solved AtCoder ABC 114 C-755 with Python3
Template AtCoder ABC 179 Python (A ~ E)
[Python] return A [or / and] B
AtCoder Beginner Contest 169 B Problem "Multiplication 2" Explanation (Python3, C ++, Java)
AtCoder Beginner Contest 170 A Problem "Five Variables" Explanation (C ++, Python, Java)
AtCoder Beginner Contest 169 A Explanation of Problem "Multiplication 1" (Python3, C ++, Java)
AtCoder Beginner Contest 176 A Explanation of problem "Takoyaki" (Python3, C ++, Java)
AtCoder Beginner Contest 175 B Problem "Making Triangle" Explanation (C ++, Python3, Java)
AtCoder Beginner Contest 175 A Problem "Rainy Season" Explanation (C ++, Python3, Java)
AtCoder Beginner Contest 176 B Problem "Multiple of 9" Explanation (Python3, C ++, Java)
AtCoder Beginner Contest 174 A Problem "Air Conditioner" Explanation (C ++, Python, Java)
Algorithm in Python (ABC 146 C Binary Search
[Python] [Explanation] AtCoder Typical DP Contest: A Contest