Skip to content

Commit bed16ad

Browse files
author
IsHYuhi
committed
ABC149-ABC152
1 parent a9e3355 commit bed16ad

File tree

10 files changed

+75
-4
lines changed

10 files changed

+75
-4
lines changed

ABC/ABC150/A.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
k, x = map(int, input().split())
2+
3+
if k*500 >= x:
4+
print('Yes')
5+
else:
6+
print('No')

ABC/ABC150/B.py

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

ABC/ABC150/C.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import numpy as np
2+
from itertools import permutations
3+
n = int(input())
4+
p = tuple(map(int, input().split()))
5+
q = tuple(map(int, input().split()))
6+
permu = [i for i in range(1, n+1)]
7+
permu = permutations(permu, n)
8+
9+
for i, s in enumerate(permu):
10+
if p == s:
11+
a = i+1
12+
if q == s:
13+
b = i+1
14+
15+
print(abs(a-b))

ABC/ABC151/A.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print(chr(ord(input())+1))

ABC/ABC151/B.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
n, k, m = map(int, input().split())
2+
a = list(map(int, input().split()))
3+
4+
ans = max(0, m*n-sum(a)) if m*n-sum(a)<=k else -1
5+
print(ans)

ABC/ABC151/C.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import numpy as np
2+
3+
n, m = map(int, input().split())
4+
P = []
5+
S = []
6+
for i in range(m):
7+
p, s = input().split()
8+
P.append(int(p))
9+
S.append(s)
10+
11+
flag = [0 for i in range(n)]
12+
wa = [0 for i in range(n)]
13+
for i in range(m):
14+
if S[i] == 'AC':
15+
flag[P[i]-1] = 1
16+
elif flag[P[i]-1] != 1:
17+
wa[P[i]-1] +=1
18+
19+
wa = sum(np.array(flag)*np.array(wa))
20+
print(sum(flag), wa)

ABC/ABC152/A.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
n, m = map(int, input().split())
2+
3+
if n==m:
4+
print('Yes')
5+
else:
6+
print('No')

ABC/ABC152/B.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(str(min(a, b))*max(a, b))

ABC/ABC152/C.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
n = int(input())
2+
p = list(map(int, input().split()))
3+
ans = 0
4+
mn = float('inf')
5+
for i in range(n):
6+
mn = min(p[i], mn)
7+
if mn == p[i]:
8+
ans += 1
9+
print(ans)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ AtCoderの問題をpython3で解いたものになります。AC確認は行っ
108108
|[ABC146](ABC/ABC146)|[&check;](ABC/ABC146/A.py)|[&check;](ABC/ABC146/B.py)|[&check;](ABC/ABC146/C.py)||||
109109
|[ABC147](ABC/ABC147)|[&check;](ABC/ABC147/A.py)|[&check;](ABC/ABC147/B.py)|||||
110110
|[ABC148](ABC/ABC148)|[&check;](ABC/ABC148/A.py)|[&check;](ABC/ABC148/B.py)|[&check;](ABC/ABC148/C.py)|[&check;](ABC/ABC148/D.py)|||
111-
|ABC149|||||||
112-
|ABC150|||||||
113-
|ABC151|||||||
114-
|ABC152|||||||
111+
|[ABC149](ABC/ABC149)|[&check;](ABC/ABC149/A.py)|[&check;](ABC/ABC149/B.py)|[&check;](ABC/ABC149/C.py)||||
112+
|[ABC150](ABC/ABC150)|[&check;](ABC/ABC150/A.py)|[&check;](ABC/ABC150/B.py)|[&check;](ABC/ABC150/C.py)||||
113+
|[ABC151](ABC/ABC151)|[&check;](ABC/ABC151/A.py)|[&check;](ABC/ABC151/B.py)|[&check;](ABC/ABC151/C.py)||||
114+
|[ABC152](ABC/ABC152)|[&check;](ABC/ABC152/A.py)|[&check;](ABC/ABC152/B.py)|[&check;](ABC/ABC152/C.py)||||
115115
|ABC153|||||||
116116
|ABC154|||||||
117117
|ABC155|||||||

0 commit comments

Comments
 (0)