Solve ABC163 A ~ C with Python

Introduction

This time it was unrated

A problem

Problem

** Thoughts ** Just calculate. Pi can be implemented in math.pi

import math
r = int(input())
print(2*r*math.pi)

B problem

Problem

** Thoughts ** Just compare n and task with the amount of tasks as tasks

n, m = map(int,input().split())
a = list(map(int,input().split()))

task = sum(a)
if task <= n:
    print(n-task)
else:
    print(-1)

C problem

Problem

** Thoughts ** Calculate the number of subordinates for all $ i $.

n = int(input())
a = list(map(int,input().split()))

mem = [0] * (n)
for i in range(n-1):
    mem[a[i]-1] += 1

for i in mem:
    print(i)

Summary

It's hard to be unrated. I want to turn brown quickly. See you again, good night.

Recommended Posts

Solve ABC163 A ~ C with Python
Solve ABC168 A ~ C with Python
Solve ABC162 A ~ C with Python
Solve ABC167 A ~ C with Python
Solve ABC158 A ~ C with Python
Solve ABC166 A ~ D with Python
Solve ABC036 A ~ C in Python
Solve ABC037 A ~ C in Python
Solve ABC175 A, B, C in Python
[AtCoder] Solve ABC1 ~ 100 A problem with Python
Solve AtCoder ABC168 with python (A ~ D)
Solve AtCoder ABC166 with python
ABC163 C problem with python3
ABC188 C problem with python3
Solve AtCoder ABC 186 with Python
ABC187 C problem with python
[AtCoder] Solve A problem of ABC101 ~ 169 with Python
Challenge AtCoder (ABC) 164 with Python! A ~ C problem
ABC127 A, B, C Explanation (python)
ABC166 in Python A ~ C problem
Solved AtCoder ABC 114 C-755 with Python3
ABC128 A, B, C commentary (python)
ABC126 A, B, C Explanation (python)
Solve Atcoder ABC176 (A, B, C, E) 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 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!
I wanted to solve ABC160 with Python
Solve ABC165 A, B, D in Python
I wanted to solve ABC172 with Python
Solve AtCoder 167 with python
Solve Sudoku with Python
Solve ABC169 in Python
ABC147 C --HonestOrUnkind2 [Python]
Solve POJ 2386 with python
I wanted to solve the ABC164 A ~ D problem with Python
Solve A ~ D of yuki coder 247 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!
[AtCoder explanation] Control the A, B, C problems of ABC185 with Python!
Solve with Ruby, Perl, Java and Python AtCoder ABC 047 C Regular Expression
[AtCoder explanation] Control the A, B, C problems of ABC187 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC184 with Python!
[Python] Solve equations with sympy
AtCoder ABC 177 Python (A ~ E)
AtCoder ABC 178 Python (A ~ E)
ABC129 A, B, C commentary
Solve ABC176 E in Python
ABC memorandum [ABC163 C --managementr] (Python)
AtCoder ABC 176 Python (A ~ E)
Solve ABC175 D in Python
Make a fortune with Python
AtCoder ABC 182 Python (A ~ D)
Create a directory with python
Try embedding Python in a C ++ program with pybind11
Make a breakpoint on the c layer 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!