Skip to content

Commit 8d955ca

Browse files
author
IsHYuhi
committed
add new ABC
1 parent db1bf54 commit 8d955ca

File tree

13 files changed

+121
-0
lines changed

13 files changed

+121
-0
lines changed

ABC/ABC016/A.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
M, D = map(int,input().split())
2+
3+
if M%D == 0:
4+
print('YES')
5+
else:
6+
print('NO')

ABC/ABC016/B.py

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

ABC/ABC016/C.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
N, M = map(int, input().split())
2+
relation = [[] for _ in range(N+1)]
3+
4+
for i in range(M):
5+
A, B = map(int, input().split())
6+
relation[A].append(B)
7+
relation[B].append(A)
8+
9+
def count_relation(re, se, n, d):
10+
for i in re:
11+
if i == se:
12+
continue
13+
d = d| set(relation[i])
14+
d = d - set(re)
15+
if se in d:
16+
return len(d)-1
17+
return len(d)
18+
19+
for i in range(1,N+1):
20+
print(count_relation(relation[i], i, 0, set()))
21+

ABC/ABC017/A.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ans = 0
2+
for i in range(3):
3+
s, e = map(int, input().split())
4+
ans += int(s*e/10)
5+
print(ans)

ABC/ABC017/B.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
S = input()
2+
3+
i = 0
4+
while i<len(S):
5+
if S[i]=='o' or S[i] == 'k' or S[i] == 'u':
6+
i+=1
7+
elif S[i:i+2]=='ch':
8+
i+=2
9+
else:
10+
break
11+
if len(S)==i:
12+
print('YES')
13+
else:
14+
print('NO')

ABC/ABC018/A.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
A = int(input())
2+
B = int(input())
3+
C = int(input())
4+
li = [A, B, C]
5+
sort = sorted(li, reverse=True)
6+
for i in li:
7+
print(sort.index(i)+1)

ABC/ABC018/B.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
S = input()
2+
N = int(input())
3+
4+
lr = [tuple(map(int, input().split())) for _ in range(N)]
5+
6+
for l, r in lr:
7+
l -= 1
8+
r -= 1
9+
S = S[:l]+S[r:l-len(S)-1:-1]+S[r+1:]
10+
print(S)

ABC/ABC019/A.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inp = list(map(int, input().split()))
2+
print(sorted(inp)[1])

ABC/ABC019/B.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from collections import deque
2+
S = input()
3+
S = deque(S)
4+
s = S.popleft()
5+
count = 1
6+
while S:
7+
t = S.popleft()
8+
if t == s:
9+
count+=1
10+
else:
11+
print(s+str(count), end='')
12+
count = 1
13+
s = t
14+
print(s+str(count))

ABC/ABC020/A.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
n = int(input())
2+
if n == 1:
3+
print('ABC')
4+
elif n == 2:
5+
print('chokudai')

0 commit comments

Comments
 (0)