# Solve ABC166 A ~ D with Python

### Introduction

Today was 4 completes from A to D. I was troubled by C today too ()

### A problem

Problem

** Thoughts ** if

``````s = input()

if s == 'ABC':
print('ARC')
else:
print('ABC')
``````

### B problem

Problem

** Thoughts ** Input was a little troublesome. Make a list of N people and see if you have sweets.

``````n, k = map(int,input().split())
d = []
a = []
for _ in range(k):
d.append(int(input()))
a.append(list(map(int,input().split())))
check = [False] * n
for i in range(k):
for j in a[i]:
check[j-1] = True

ans = 0
for i in range(n):
if not check[i]:
ans += 1
print(ans)
``````

### C problem

Problem

** Thoughts ** Make a list of the number of connected roads and check the size. I did not process when the height is the same and 3WA came out. I will not forgive you.

``````n, m = map(int,input().split())
h = list(map(int,input().split()))
ab = [(list(map(int,input().split()))) for _ in range(m)]

path =  * n
check =  * n
for i in range(m):
path[ab[i]-1] += 1
path[ab[i]-1] += 1
if h[ab[i]-1] < h[ab[i]-1]:
check[ab[i]-1] += 1
elif h[ab[i]-1] == h[ab[i]-1]:
continue
else:
check[ab[i]-1] += 1

ans = 0
for i in range(n):
if path[i] == check[i]:
ans +=1

print(ans)
``````

### D problem

Problem

** Thoughts ** Mathematics? You don't know. I searched all over \$ -1000 <= a, b <= 1000 \$.

``````x = int(input())

for i in range(-1000,1000):
for j in range(-1000,1000):
if i ** 5 - j ** 5 == x:
print(i,j)
quit()
``````

### Summary

It is not good because the details are overlooked and pena grows and time is lost. Again, C and D were solved sooner. It is mortifying. See you again, good night.