Skip to content

Commit ff8ae85

Browse files
author
IsHYuhi
committed
ABC136-ABC139
1 parent ed62e27 commit ff8ae85

File tree

14 files changed

+85
-4
lines changed

14 files changed

+85
-4
lines changed

ABC/ABC136/A.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
a, b, c = map(int, input().split())
2+
print(c - min((a-b), c))

ABC/ABC136/B.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
n = int(input())
2+
ans = 0
3+
for i in range(1, n+1):
4+
if len(str(i))%2 == 1:
5+
ans += 1
6+
print(ans)

ABC/ABC136/C.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
n = int(input())
2+
h = list(map(int, input().split()))
3+
4+
for i in range(1,n):
5+
if h[i-1]-h[i]>0:
6+
print('No')
7+
exit()
8+
elif h[i-1]-h[i] <= -1:
9+
h[i] -= 1
10+
print('Yes')
11+

ABC/ABC137/A.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
a, b = map(int, input().split())
2+
print(max(a+b, a-b, a*b))

ABC/ABC137/B.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
k, x = map(int, input().split())
2+
ans = [str(i) for i in range(x-k+1, x+k)]
3+
print(' '.join(ans))

ABC/ABC137/C.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from collections import Counter
2+
n = int(input())
3+
s = [tuple(sorted(input())) for _ in range(n)]
4+
5+
c = Counter(s)
6+
ans = 0
7+
for i in c.values():
8+
ans += i*(i-1)//2
9+
print(ans)

ABC/ABC138/A.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a = int(input())
2+
s = input()
3+
if a>=3200:
4+
print(s)
5+
else:
6+
print('red')

ABC/ABC138/B.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
n = int(input())
2+
a = map(lambda x: 1/int(x), input().split())
3+
print(1/sum(a))

ABC/ABC138/C.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from collections import deque
2+
n = int(input())
3+
v = deque(sorted(list(map(int, input().split()))))
4+
for i in range(n-1):
5+
v1 = v.popleft()
6+
v2 = v.popleft()
7+
v.appendleft((v1+v2)/2)
8+
print(v[0])

ABC/ABC139/A.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
s = input()
2+
t = input()
3+
ans = 0
4+
for i in range(len(s)):
5+
if s[i]==t[i]:
6+
ans += 1
7+
print(ans)

0 commit comments

Comments
 (0)