Skip to content

Commit 9fd9c1d

Browse files
author
IsHYuhi
committed
add ABC56-60
1 parent 8ba1295 commit 9fd9c1d

File tree

13 files changed

+96
-0
lines changed

13 files changed

+96
-0
lines changed

ABC/ABC056/A.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
a, b = map(lambda x:True if x=='H' else False, input().split())
2+
if a ^ b:
3+
print('D')
4+
else:
5+
print('H')

ABC/ABC056/B.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
W, a, b = map(int, input().split())
2+
3+
if a<=b<=a+W:
4+
print(0)
5+
else:
6+
print(min(abs(b - a+W), abs(a- b+W)))

ABC/ABC056/C.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
x = abs(int(input()))
2+
ans = 0
3+
length = 0
4+
while x > length:
5+
ans+=1
6+
length += ans
7+
print(ans)
8+

ABC/ABC057/A.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
a, b = map(int, input().split())
2+
3+
print((a+b)%24)

ABC/ABC057/B.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
n, m = map(int, input().split())
2+
3+
abes = [list(map(int, input().split())) for _ in range(n)]
4+
cdes = [list(map(int, input().split())) for _ in range(m)]
5+
6+
for a, b in abes:
7+
mi = sorted(cdes, key=lambda x : abs(x[0]-a)+abs(x[1]-b))
8+
print(cdes.index(mi[0])+1)

ABC/ABC058/A.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a, b, c = map(int, input().split())
2+
3+
if b-a==c-b:
4+
print('YES')
5+
else:
6+
print('NO')

ABC/ABC058/B.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from collections import deque
2+
o = deque(list(input()))
3+
e = deque(list(input()))
4+
while e:
5+
print(o.popleft(), end='')
6+
print(e.popleft(), end='')
7+
8+
if o:
9+
print(o.popleft(), end='')
10+
print('')

ABC/ABC058/C.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from collections import Counter
2+
n = int(input())
3+
Si = [Counter(input()) for _ in range(n)]
4+
letters = set(Si[0].keys())
5+
for S in Si:
6+
letters = set(S.keys()) & letters
7+
letters = list(letters)
8+
letters.sort()
9+
for key in letters:
10+
count = float('inf')
11+
for S in Si:
12+
count = min(count, S[key])
13+
print(key*count, end='')
14+
print('')

ABC/ABC059/A.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
s1, s2, s3 = map(lambda x: x.capitalize(), input().split())
2+
print(s1[0]+s2[0]+s3[0])

ABC/ABC059/B.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
a = int(input())
2+
b = int(input())
3+
4+
if a<b:
5+
print('LESS')
6+
elif a>b:
7+
print('GREATER')
8+
elif a==b:
9+
print('EQUAL')

ABC/ABC060/A.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a, b, c = input().split()
2+
3+
if a[-1]==b[0] and b[-1]==c[0]:
4+
print('YES')
5+
else:
6+
print('NO')

ABC/ABC060/B.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
a, b, c = map(int, input().split())
2+
3+
for i in range(b+1):
4+
if a*i%b==c:
5+
print('YES')
6+
exit()
7+
print('NO')

ABC/ABC060/C.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
n, t = map(int, input().split())
2+
ts = list(map(int, input().split()))
3+
4+
ans = 0
5+
now = 0
6+
for i in ts[1:]:
7+
if i<=now+t:
8+
ans += i-now
9+
else:
10+
ans += t
11+
now = i
12+
print(ans+t)

0 commit comments

Comments
 (0)