Skip to content

Commit f8141b0

Browse files
author
IsHYuhi
committed
ABC140-ABC142
1 parent ff8ae85 commit f8141b0

File tree

10 files changed

+75
-3
lines changed

10 files changed

+75
-3
lines changed

ABC/ABC140/A.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
n = int(input())
2+
print(n**3)

ABC/ABC140/B.py

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

ABC/ABC140/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+
b = list(map(int, input().split()))
3+
ans = b[0]
4+
p = b[0]
5+
for i in b[1:]:
6+
ans += min(p, i)
7+
p = i
8+
ans += b[-1]
9+
print(ans)

ABC/ABC141/A.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
s = input()
2+
3+
if s[0]=='S':
4+
print('Cloudy')
5+
elif s[0]=='C':
6+
print('Rainy')
7+
else:
8+
print('Sunny')

ABC/ABC141/B.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
s = list(input())
2+
3+
for i in s[::2]:
4+
if i=='L':
5+
print('No')
6+
exit()
7+
8+
for i in s[1::2]:
9+
if i=='R':
10+
print('No')
11+
exit()
12+
13+
print('Yes')

ABC/ABC141/C.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
n, k, q = map(int, input().split())
2+
a = [int(input()) for i in range(q)]
3+
p = [k-q]*n
4+
5+
for i in a:
6+
p[i-1] += 1
7+
8+
for i in p:
9+
if i>0:
10+
print('Yes')
11+
else:
12+
print('No')

ABC/ABC142/A.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
n = int(input())
2+
3+
if n%2==0:
4+
print(1/2)
5+
else:
6+
print((n//2 + 1)/n)

ABC/ABC142/B.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
n, k = map(int, input().split())
2+
h = list(map(int, input().split()))
3+
print(len([i for i in h if i>=k]))

ABC/ABC142/C.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
n = int(input())
2+
a = list(map(int, input().split()))
3+
a = [(i, j) for i, j in enumerate(a, start=1)]
4+
a.sort(key=lambda x: x[1])
5+
a = [str(i) for i, j in a]
6+
print(' '.join(a))

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ AtCoderの問題をpython3で解いたものになります。AC確認は行っ
9999
|[ABC137](ABC/ABC137)|[✓](ABC/ABC137/A.py)|[✓](ABC/ABC137/B.py)|[✓](ABC/ABC137/C.py)||||
100100
|[ABC138](ABC/ABC138)|[✓](ABC/ABC138/A.py)|[✓](ABC/ABC138/B.py)|[✓](ABC/ABC138/C.py)||||
101101
|[ABC139](ABC/ABC139)|[✓](ABC/ABC139/A.py)|[✓](ABC/ABC139/B.py)|[✓](ABC/ABC139/C.py)|[✓](ABC/ABC139/D.py)|||
102-
|ABC140|||||||
103-
|ABC141|||||||
104-
|ABC142|||||||
102+
|[ABC140](ABC/ABC140)|[✓](ABC/ABC140/A.py)|[✓](ABC/ABC140/B.py)|[✓](ABC/ABC140/C.py)||||
103+
|[ABC141](ABC/ABC141)|[✓](ABC/ABC141/A.py)|[✓](ABC/ABC141/B.py)|[✓](ABC/ABC141/C.py)||||
104+
|[ABC142](ABC/ABC142)|[✓](ABC/ABC142/A.py)|[✓](ABC/ABC142/B.py)|[✓](ABC/ABC142/C.py)||||
105105
|ABC143|||||||
106106
|ABC144|||||||
107107
|ABC145|||||||

0 commit comments

Comments
 (0)