Skip to content

Commit 8ba1295

Browse files
author
IsHYuhi
committed
ABC51-55
1 parent 042970d commit 8ba1295

File tree

16 files changed

+178
-66
lines changed

16 files changed

+178
-66
lines changed

ABC/ABC051/A.py

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

ABC/ABC051/B.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from bisect import bisect
2+
k, s = map(int, input().split())
3+
ans = 0
4+
rekkyo = []
5+
for i in range(0,k+1):
6+
for j in range(0,k+1):
7+
if 0<=s-i-j<=k:
8+
ans+=1
9+
print(ans)

ABC/ABC052/A.py

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

ABC/ABC052/B.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
n = int(input())
2+
s = input()
3+
x = 0
4+
ans = 0
5+
for i in s:
6+
if i=='I':
7+
x+=1
8+
elif i=="D":
9+
x-=1
10+
ans = max(ans, x)
11+
print(ans)

ABC/ABC053/A.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if int(input())<1200:
2+
print('ABC')
3+
else:
4+
print('ARC')

ABC/ABC053/B.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
s = input()
2+
for i, st in enumerate(s):
3+
if st=='A':
4+
start = i
5+
break
6+
for i, st in enumerate(s):
7+
if st=='Z':
8+
end = i
9+
print(end-start+1)

ABC/ABC053/C.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import math
2+
x = int(input())
3+
4+
if x<=6:
5+
print(1)
6+
elif x<=11:
7+
print(2)
8+
else:
9+
ans = (x//11)*2
10+
res = (x%11)
11+
if res==0:
12+
res =0
13+
elif res<=6:
14+
res = 1
15+
elif res<=11:
16+
res = 2
17+
print(ans+res)

ABC/ABC054/A.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
A, B = map(int, input().split())
2+
if A==B:
3+
print('Draw')
4+
elif A==1:
5+
print('Alice')
6+
elif B==1:
7+
print('Bob')
8+
elif A>B:
9+
print('Alice')
10+
else:
11+
print('Bob')

ABC/ABC054/C.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
N, M = map(int, input().split())
2+
#ab = [list(map(int, input().split())) for i in range(M)]
3+
ab = [[] for _ in range(N)]
4+
5+
for _ in range(M):
6+
a, b = map(int,input().split())
7+
ab[a-1].append(b-1)
8+
ab[b-1].append(a-1)
9+
#print(ab)
10+
11+
count = 0
12+
13+
def dfs(i, now, done):
14+
global count
15+
if i == N-1:
16+
count += 1
17+
#print(now+1)
18+
#print('-----')
19+
return
20+
21+
for j in ab[now]:
22+
#print(j, done)
23+
if j not in done:
24+
#print(j+1)
25+
#done.append(j)
26+
dfs(i+1, j, done + [j])##引数はバラして入れる!
27+
return
28+
29+
dfs(0, 0, [0])
30+
print(count)
31+
32+
# import itertools
33+
34+
# n, m = map(int, input().split())
35+
36+
# path = [[False] * n for i in range(n)]
37+
# for i in range(m):
38+
# a, b = map(int, input().split())
39+
# a -= 1
40+
# b -= 1
41+
# path[a][b] = True
42+
# path[b][a] = True
43+
44+
# ans = 0
45+
46+
# for i in itertools.permutations(range(n), n):#N!
47+
# if i[0] == 0:
48+
# for j in range(n):
49+
# if j == n - 1:
50+
# ans += 1
51+
# break
52+
# if not path[i[j]][i[j + 1]]:
53+
# break
54+
55+
# print(ans)

ABC/ABC055/A.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,2 @@
1-
A, B = map(int, input().split())
2-
if A==B:
3-
print('Draw')
4-
elif A==1:
5-
print('Alice')
6-
elif B==1:
7-
print('Bob')
8-
elif A>B:
9-
print('Alice')
10-
else:
11-
print('Bob')
1+
n = int(input())
2+
print(n*800-(n//15)*200)

0 commit comments

Comments
 (0)