Skip to content

Commit 94a5823

Browse files
author
IsHYuhi
committed
ABC61-65
1 parent 9fd9c1d commit 94a5823

File tree

15 files changed

+147
-4
lines changed

15 files changed

+147
-4
lines changed

ABC/ABC045/B.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
dic = {'A':a, 'B':b, 'C':c}
77
pop = dic['A'].popleft().upper()
88

9-
109
while dic[pop]:
1110
pop = dic[pop].popleft().upper()
1211

13-
print(pop)
14-
15-
12+
print(pop)

ABC/ABC061/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 a<=c<=b:
4+
print('Yes')
5+
else:
6+
print('No')

ABC/ABC061/B.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
n, m = map(int, input().split())
2+
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+
10+
for i in ab:
11+
print(len(i))

ABC/ABC061/C.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
n, k = map(int, input().split())
2+
ab = [tuple(map(int, input().split())) for _ in range(n)]
3+
ab.sort(key=lambda x: x[0])
4+
sm = 0
5+
for a, b in ab:
6+
sm += b
7+
if sm >= k:
8+
print(a)
9+
break
10+

ABC/ABC062/A.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
x, y = map(int, input().split())
2+
b = [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]
3+
4+
if b[x]==b[y]:
5+
print('Yes')
6+
else:
7+
print('No')

ABC/ABC062/B.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
h, w = map(int, input().split())
2+
3+
field = [input() for _ in range(h)]
4+
5+
print('#'*(w+2))
6+
for f in field:
7+
print('#'+f+'#')
8+
print('#'*(w+2))

ABC/ABC063/A.py

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

ABC/ABC063/B.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from collections import Counter
2+
S = input()
3+
Sd = Counter(S)
4+
5+
if len(Sd)==len(S):
6+
print('yes')
7+
else:
8+
print('no')

ABC/ABC063/C.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
n = int(input())
2+
s = [int(input()) for _ in range(n)]
3+
s.sort(reverse=True)
4+
sm = sum(s)
5+
ans = 0
6+
while (sm - ans)%10==0 and s:
7+
now = s.pop()
8+
ans += now
9+
if(sm - now)%10!=0:
10+
ans = now
11+
break
12+
13+
print(sm - ans)

ABC/ABC064/A.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
s = ''.join(list(input().split()))
2+
3+
if int(s)%4==0:
4+
print('YES')
5+
else:
6+
print('NO')

ABC/ABC064/B.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
n = int(input())
2+
a = list(map(int, input().split()))
3+
a.sort()
4+
5+
print(a[-1]-a[0])

ABC/ABC064/C.py

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
def color_judge(n):
2+
if 1<=n<=399:
3+
return 'gray'
4+
elif n<=799:
5+
return 'brown'
6+
elif n<=1199:
7+
return 'green'
8+
elif n<=1599:
9+
return 'light blue'
10+
elif n<=1999:
11+
return 'blue'
12+
elif n<=2399:
13+
return 'yellow'
14+
elif n<=2799:
15+
return 'orange'
16+
elif n<=3199:
17+
return 'red'
18+
else:
19+
return 'choice'
20+
21+
n = int(input())
22+
a = list(map(int, input().split()))
23+
dic = {}
24+
for i in a:
25+
if dic.get(color_judge(i)):
26+
dic[color_judge(i)] += 1
27+
else:
28+
dic[color_judge(i)] = 1
29+
choice = 0
30+
l = len(dic)
31+
if dic.get('choice'):
32+
choice = dic['choice']
33+
l -= 1
34+
print(max(1, l), min(8, l+choice))

ABC/ABC065/A.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
x, a, b = map(int, input().split())
2+
3+
if b-a<=0:
4+
print('delicious')
5+
elif b-a <= x:
6+
print('safe')
7+
else:
8+
print('dangerous')

ABC/ABC065/B.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
n = int(input())
2+
a = [int(input()) for _ in range(n)]
3+
ans = 1
4+
count = 0
5+
while ans!=2:
6+
ans = a[ans-1]
7+
count += 1
8+
if count > len(a):
9+
print(-1)
10+
exit()
11+
print(count)
12+

ABC/ABC065/C.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import math
2+
n, m = map(int, input().split())
3+
4+
mx = max(n, m)
5+
mn = min(n, m)
6+
7+
if n == m:
8+
print((2*math.factorial(n)*math.factorial(m))%(10**9+7))
9+
elif n==m-1 or n==m+1:
10+
print((math.factorial(n)*math.factorial(m))%(10**9+7))
11+
else:
12+
print(0)

0 commit comments

Comments
 (0)