Skip to content

Commit 6ed5d16

Browse files
author
IsHYuhi
committed
ABC81-85
1 parent 5506939 commit 6ed5d16

File tree

12 files changed

+83
-0
lines changed

12 files changed

+83
-0
lines changed

ABC/ABC081/A.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
s = map(int, list(input()))
2+
print(sum(s))

ABC/ABC081/B.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
n = int(input())
2+
a = list(map(int, input().split()))
3+
ans = 0
4+
while True:
5+
for i in range(len(a)):
6+
if not a[i]%2==0:
7+
print(ans)
8+
exit()
9+
else:
10+
a[i] = a[i]//2
11+
ans += 1

ABC/ABC081/C.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from collections import Counter
2+
from collections import deque
3+
n, k = map(int, input().split())
4+
a = Counter(list(map(int, input().split())))
5+
a = [tuple(i) for i in a.items()]
6+
a.sort(key=lambda x: x[1])
7+
a = deque(a)
8+
ans = 0
9+
while k<len(a):
10+
ans += a.popleft()[1]
11+
print(ans)

ABC/ABC082/A.py

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

ABC/ABC082/B.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
s = list(input())
2+
t = list(input())
3+
s.sort()
4+
t.sort(reverse=True)
5+
s = ''.join(s)
6+
t = ''.join(t)
7+
if s<t:
8+
print('Yes')
9+
else:
10+
print('No')

ABC/ABC082/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+
a = Counter(list(map(int, input().split())))
4+
5+
a = [i for i in a.items() if i[0]!=i[1]]
6+
ans = 0
7+
8+
for i, j in a:
9+
if i>j:
10+
ans += j
11+
else:
12+
ans += j-i
13+
14+
print(ans)

ABC/ABC083/A.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
a, b, c, d = map(int, input().split())
2+
l = a+b
3+
r = c+d
4+
if l==r:
5+
print('Balanced')
6+
elif l>r:
7+
print('Left')
8+
else:
9+
print('Right')

ABC/ABC083/B.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
n, a, b = map(int, input().split())
2+
ans = 0
3+
for i in range(1,n+1):
4+
num = sum(list(map(int, list(str(i)))))
5+
if a<=num<=b:
6+
ans += i
7+
print(ans)

ABC/ABC084/A.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(48-int(input()))

ABC/ABC084/B.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
a, b = map(int, input().split())
2+
s = input().split('-')
3+
if len(s)!=2:
4+
print('No')
5+
exit()
6+
7+
if a==len(s[0]) and b==len(s[1]):
8+
print('Yes')
9+
else:
10+
print('No')

ABC/ABC085/A.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print('2018'+input()[4:])

ABC/ABC085/B.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from collections import Counter
2+
n = int(input())
3+
d = Counter([int(input()) for _ in range(n)])
4+
print(len(d))

0 commit comments

Comments
 (0)