ABC128 A, B, C commentary (python)

A problem

https://atcoder.jp/contests/abc128/tasks/abc128_a

a,p = map(int,input().split())
print((a*3+p)//2)

The answer is a × 3 + p divided by 2.

B problem

https://atcoder.jp/contests/abc128/tasks/abc128_b

n = int(input())
x = [[input().split(),i+1]for i in range(n)]
x = sorted(x, key = lambda x:(x[0][0],-int(x[0][1])))
for i in range(n):
    print(x[i][1])

The problem of sorting on multiple elements. x = sorted(x, key = lambda x:(x[0][0],-int(x[0][1]))) If multiple keys are specified in, sorting is performed in the order of x [0] [0], -int (x [0] [1]). Since the output is by number, create a list that includes the number when entering x.

C problem

https://atcoder.jp/contests/abc128/tasks/abc128_c





Recommended Posts

ABC128 A, B, C commentary (python)
ABC129 A, B, C commentary
ABC126 A, B, C Explanation (python)
Solve ABC163 A ~ C 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
Solve ABC037 A ~ C in Python
[AtCoder explanation] Control ABC180 A, B, C problems with Python!
[AtCoder explanation] Control ABC188 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!
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 explanation] Control the A, B, C problems of ABC182 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC186 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC185 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC187 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC184 with Python!
AtCoder ABC 177 Python (A ~ E)
ABC163 C problem with python3
AtCoder ABC 178 Python (A ~ E)
AtCoder ABC 176 Python (A ~ E)
AtCoder ABC 182 Python (A ~ D)
ABC188 C problem with python3
ABC187 C problem 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 a + = b and a = a + b are different
ABC memorandum [ABC159 C --Maximum Volume] (Python)
Solve ABC166 A ~ D with Python
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 commentary] Win the ABC165 C problem "Many Requirements" with Python!
Algorithm in Python (ABC 146 C Binary Search
ABC memorandum [ABC157 C --Guess The Number] (Python)
Solve AtCoder ABC168 with python (A ~ D)
Beginner ABC154 (Python)
Beginner ABC156 (Python)
AtCoder ABC 174 Python
AtCoder ABC187 Python
AtCoder ABC188 Python
Beginner ABC155 (Python)
python C ++ notes
Beginner ABC157 (Python)
What happens if you do "import A, B as C" in Python?
AtCoder ABC 175 Python
Run a Python script from a C # GUI application
ABC memorandum [ABC160 C --Traveling Salesman around Lake] (Python)
python memo-"if not A and B" was "if (not A) and B"
I tried adding a Python3 module in C