Skip to content

Commit ed62e27

Browse files
author
IsHYuhi
committed
ABC135
1 parent 0dfe37b commit ed62e27

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

ABC/ABC135/A.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a, b = map(int, input().split())
2+
3+
if (max(a,b)-min(a,b))%2 == 0:
4+
print((max(a,b)-min(a,b))//2+min(a,b))
5+
else:
6+
print('IMPOSSIBLE')

ABC/ABC135/B.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from itertools import combinations
2+
3+
n = int(input())
4+
p = list(map(int, input().split()))
5+
6+
combi = combinations([i for i in range(n)], 2)
7+
sort = sorted(p)
8+
9+
if sort == p:
10+
print('YES')
11+
exit()
12+
13+
for i, j in combi:
14+
p[i], p[j] = p[j], p[i]
15+
if sort == p:
16+
print('YES')
17+
exit()
18+
p[j], p[i] = p[i], p[j]
19+
print('NO')

ABC/ABC135/C.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
n = int(input())
2+
a = list(map(int, input().split()))
3+
b = list(map(int, input().split()))
4+
5+
ans = 0
6+
for i, v in enumerate(b):
7+
for j in range(2):
8+
m = min(a[i+j], v)
9+
a [i+j] -= m
10+
v -= m
11+
ans += m
12+
print(ans)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ AtCoderの問題をpython3で解いたものになります。AC確認は行っ
9494
|[ABC132](ABC/ABC132)|[✓](ABC/ABC132/A.py)|[✓](ABC/ABC132/B.py)|[✓](ABC/ABC132/C.py)|||||[ABC172](ABC/ABC172)|[✓](ABC/ABC172/A.py)|[✓](ABC/ABC172/B.py)|||||
9595
|[ABC133](ABC/ABC133)|[✓](ABC/ABC133/A.py)|[✓](ABC/ABC133/B.py)|[✓](ABC/ABC133/C.py)|||||[ABC173](ABC/ABC173)|[✓](ABC/ABC173/A.py)|[✓](ABC/ABC173/B.py)|[✓](ABC/ABC173/C.py)|[✓](ABC/ABC173/D.py)|||
9696
|[ABC134](ABC/ABC134)|[✓](ABC/ABC134/A.py)|[✓](ABC/ABC134/B.py)|[✓](ABC/ABC134/C.py)|||||ABC174|||||||
97-
|ABC135||||||||ABC175|||||||
97+
|[ABC135](ABC/ABC135)|[✓](ABC/ABC135/A.py)|[✓](ABC/ABC135/B.py)|[✓](ABC/ABC135/C.py)|||||ABC175|||||||
9898
|ABC136||||||||[ABC176](ABC/ABC176)|[✓](ABC/ABC176/A.py)|[✓](ABC/ABC176/B.py)|[✓](ABC/ABC176/C.py)||||
9999
|ABC137|||||||
100100
|ABC138|||||||

0 commit comments

Comments
 (0)