Skip to content

Commit f6e0181

Browse files
Merge pull request #49 from KoyanagiHitoshi/dev
Dev
2 parents d9f874b + 0eee360 commit f6e0181

File tree

168 files changed

+624
-566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+624
-566
lines changed

CHANGELOG.md

100755100644
+5

code/answer_4-1-118.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
A, B = map(int, input().split())
2-
X = [[1, 2], [2, 3], [4, 5], [5, 6], [7, 8], [8, 9]]
3-
if [A, B] in X:
1+
S = input()
2+
if S in ["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]:
43
print("Yes")
54
else:
65
print("No")

code/answer_4-1-119.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
a, b = map(int, input().split())
2-
graph = [[1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8],
3-
[4, 9], [5, 10], [5, 11], [6, 12], [6, 13], [7, 14], [7, 15]]
4-
if [a, b] in graph:
1+
A, B = map(int, input().split())
2+
X = [[1, 2], [2, 3], [4, 5], [5, 6], [7, 8], [8, 9]]
3+
if [A, B] in X:
54
print("Yes")
65
else:
76
print("No")

code/answer_4-1-120.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
A, B = map(int, input().split())
2-
X = {(1, 2), (2, 3), (4, 5), (5, 6), (7, 8), (8, 9)}
3-
if (A, B) in X:
1+
a, b = map(int, input().split())
2+
graph = [[1, 2], [1, 3], [2, 4], [2, 5], [3, 6], [3, 7], [4, 8],
3+
[4, 9], [5, 10], [5, 11], [6, 12], [6, 13], [7, 14], [7, 15]]
4+
if [a, b] in graph:
45
print("Yes")
56
else:
67
print("No")

code/answer_4-1-121.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
a, b = map(int, input().split())
2-
graph = {(1, 2), (1, 3), (2, 4), (2, 5), (3, 6), (3, 7), (4, 8),
3-
(4, 9), (5, 10), (5, 11), (6, 12), (6, 13), (7, 14), (7, 15)}
4-
if (a, b) in graph:
1+
A, B = map(int, input().split())
2+
X = {(1, 2), (2, 3), (4, 5), (5, 6), (7, 8), (8, 9)}
3+
if (A, B) in X:
54
print("Yes")
65
else:
76
print("No")

code/answer_4-1-122.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
A, B, C = map(int, input().split())
2-
if A <= C <= B:
1+
a, b = map(int, input().split())
2+
graph = {(1, 2), (1, 3), (2, 4), (2, 5), (3, 6), (3, 7), (4, 8),
3+
(4, 9), (5, 10), (5, 11), (6, 12), (6, 13), (7, 14), (7, 15)}
4+
if (a, b) in graph:
35
print("Yes")
46
else:
57
print("No")

code/answer_4-1-123.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
N = int(input())
2-
if -2**31 <= N < 2**31:
1+
A, B, C = map(int, input().split())
2+
if A <= C <= B:
33
print("Yes")
44
else:
55
print("No")

code/answer_4-1-124.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
X, Y = map(int, input().split())
2-
if -3 <= Y-X <= 2:
1+
N = int(input())
2+
if -2**31 <= N < 2**31:
33
print("Yes")
44
else:
55
print("No")

code/answer_4-1-125.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a, b, c = map(int, input().split())
2-
if a <= b <= c or c <= b <= a:
1+
X, Y = map(int, input().split())
2+
if -3 <= Y-X <= 2:
33
print("Yes")
44
else:
55
print("No")

code/answer_4-1-126.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
N, X, Y, Z = map(int, input().split())
2-
if X < Z < Y or X > Z > Y:
1+
a, b, c = map(int, input().split())
2+
if a <= b <= c or c <= b <= a:
33
print("Yes")
44
else:
55
print("No")

code/answer_4-1-127.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
X = int(input())
2-
if 0 <= X < 40:
3-
print(40-X)
4-
elif 40 <= X < 70:
5-
print(70-X)
6-
elif 70 <= X < 90:
7-
print(90-X)
1+
N, X, Y, Z = map(int, input().split())
2+
if X < Z < Y or X > Z > Y:
3+
print("Yes")
84
else:
9-
print("expert")
5+
print("No")

code/answer_4-1-128.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
a, b, c, d = map(int, input())
2-
if a == b == c or b == c == d:
3-
print("Yes")
1+
X = int(input())
2+
if 0 <= X < 40:
3+
print(40-X)
4+
elif 40 <= X < 70:
5+
print(70-X)
6+
elif 70 <= X < 90:
7+
print(90-X)
48
else:
5-
print("No")
9+
print("expert")

code/answer_4-1-129.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
a, b, c, d = map(int, input())
2-
if a != b != c != d:
3-
print("Good")
2+
if a == b == c or b == c == d:
3+
print("Yes")
44
else:
5-
print("Bad")
5+
print("No")

code/answer_4-1-130.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
A, B = map(int, input().split())
2-
if A <= B <= 6*A:
3-
print("Yes")
1+
a, b, c, d = map(int, input())
2+
if a != b != c != d:
3+
print("Good")
44
else:
5-
print("No")
5+
print("Bad")

code/answer_4-1-131.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
A, B = map(int, input().split())
2-
if 1 <= A <= 9 and 1 <= B <= 9:
3-
print(A*B)
2+
if A <= B <= 6*A:
3+
print("Yes")
44
else:
5-
print(-1)
5+
print("No")

code/answer_4-1-132.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
V, T, S, D = map(int, input().split())
2-
if V*T <= D <= V*S:
3-
print("No")
1+
A, B = map(int, input().split())
2+
if 1 <= A <= 9 and 1 <= B <= 9:
3+
print(A*B)
44
else:
5-
print("Yes")
5+
print(-1)

code/answer_4-1-133.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
A, B, X = map(int, input().split())
2-
if A <= X <= A+B:
3-
print("YES")
1+
V, T, S, D = map(int, input().split())
2+
if V*T <= D <= V*S:
3+
print("No")
44
else:
5-
print("NO")
5+
print("Yes")

code/answer_4-1-134.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
A, B, X = map(int, input().split())
2-
if 0 <= X-A <= B:
2+
if A <= X <= A+B:
33
print("YES")
44
else:
55
print("NO")

code/answer_4-1-135.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
S, T, X = map(int, input().split())
2-
if S < T:
3-
if S <= X < T:
4-
print("Yes")
5-
else:
6-
print("No")
1+
A, B, X = map(int, input().split())
2+
if 0 <= X-A <= B:
3+
print("YES")
74
else:
8-
if X < T or S <= X:
9-
print("Yes")
10-
else:
11-
print("No")
5+
print("NO")

code/answer_4-1-136.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
n = int(input())
2-
if 2 <= n <= 4:
3-
print("No")
1+
S, T, X = map(int, input().split())
2+
if S < T:
3+
if S <= X < T:
4+
print("Yes")
5+
else:
6+
print("No")
47
else:
5-
print("Yes")
8+
if X < T or S <= X:
9+
print("Yes")
10+
else:
11+
print("No")

code/answer_4-1-137.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a, b, c = input()
2-
if a == b == c:
3-
print("Won")
1+
n = int(input())
2+
if 2 <= n <= 4:
3+
print("No")
44
else:
5-
print("Lost")
5+
print("Yes")

code/answer_4-1-138.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a, b, c, d = input()
2-
if a == b == c or b == c == d:
3-
print("Yes")
1+
a, b, c = input()
2+
if a == b == c:
3+
print("Won")
44
else:
5-
print("No")
5+
print("Lost")

code/answer_4-1-139.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
S = input()
2-
if "ABC001" <= S <= "ABC349" and S != "ABC316":
1+
a, b, c, d = input()
2+
if a == b == c or b == c == d:
33
print("Yes")
44
else:
55
print("No")

code/answer_4-1-140.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a, b, c, d = input()
2-
if a != b != c != d:
3-
print("Good")
1+
S = input()
2+
if "ABC001" <= S <= "ABC349" and S != "ABC316":
3+
print("Yes")
44
else:
5-
print("Bad")
5+
print("No")

code/answer_4-1-141.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
a, b, c, d = input()
2+
if a != b != c != d:
3+
print("Good")
4+
else:
5+
print("Bad")

code/answer_5-3-100.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
N = input()
2-
print(N.zfill(4))
1+
S = input().split()
2+
for s in S:
3+
print(s[0].upper(), end="")

code/answer_5-3-101.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
N = int(input())
2-
if N < 42:
3-
print("AGC"+str(N).zfill(3))
4-
else:
5-
print("AGC"+str(N+1).zfill(3))
1+
N, K = map(int, input().split())
2+
S = input()
3+
print(S[:K-1]+S[K-1:K].lower()+S[K:])

code/answer_5-3-102.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
N = int(input())
2-
print(f"{N:04}")
1+
S = input()
2+
if S == S[0].upper()+S[1:].lower():
3+
print("Yes")
4+
else:
5+
print("No")

code/answer_5-3-103.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
N = int(input())
2-
if N < 42:
3-
print(f"AGC{N:03}")
4-
else:
5-
print(f"AGC{N+1:03}")
1+
S = input()
2+
idx = 1
3+
for s in S:
4+
if s.isupper():
5+
break
6+
else:
7+
idx += 1
8+
print(idx)

code/answer_5-3-104.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
A, B = map(int, input().split())
2-
print(f"{B/A:.3f}")
1+
N = input()
2+
print(N.zfill(4))

code/answer_5-3-105.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
N = int(input())
2-
print(f"{N:02X}")
2+
if N < 42:
3+
print("AGC"+str(N).zfill(3))
4+
else:
5+
print("AGC"+str(N+1).zfill(3))

code/answer_5-3-106.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N = int(input())
2+
print(f"{N:04}")

code/answer_5-3-107.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
N = int(input())
2+
if N < 42:
3+
print(f"AGC{N:03}")
4+
else:
5+
print(f"AGC{N+1:03}")

code/answer_5-3-108.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(f"{B/A:.3f}")

code/answer_5-3-109.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N = int(input())
2+
print(f"{N:02X}")

code/answer_5-3-11.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
a, b, c = input()
2-
abc = a+b+c
3-
bca = b+c+a
4-
cab = c+a+b
5-
print(int(abc)+int(bca)+int(cab))
2+
print(b+c+a, c+a+b)

code/answer_5-3-12.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
r, g, b = input().split()
2-
if int(r+g+b) % 4 == 0:
3-
print("YES")
4-
else:
5-
print("NO")
1+
a, b, c = input()
2+
abc = a+b+c
3+
bca = b+c+a
4+
cab = c+a+b
5+
print(int(abc)+int(bca)+int(cab))

code/answer_5-3-13.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
N = int(input())
2-
S = input()
3-
ans = ""
4-
for s in S:
5-
ans += s+s
6-
print(ans)
1+
r, g, b = input().split()
2+
if int(r+g+b) % 4 == 0:
3+
print("YES")
4+
else:
5+
print("NO")

code/answer_5-3-14.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
N = int(input())
12
S = input()
23
ans = ""
34
for s in S:
4-
if s != ".":
5-
ans += s
5+
ans += s+s
66
print(ans)

code/answer_5-3-15.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
N = int(input())
2-
s = ""
3-
for i in range(1, N+1):
4-
if i % 3 == 0:
5-
s += "x"
6-
else:
7-
s += "o"
8-
print(s)
1+
S = input()
2+
ans = ""
3+
for s in S:
4+
if s != ".":
5+
ans += s
6+
print(ans)

code/answer_5-3-16.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
N = int(input())
2-
print("L"+"o"*N+"ng")
2+
s = ""
3+
for i in range(1, N+1):
4+
if i % 3 == 0:
5+
s += "x"
6+
else:
7+
s += "o"
8+
print(s)

code/answer_5-3-17.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
N = int(input())
2-
print("1"+"01"*N)
2+
print("L"+"o"*N+"ng")

code/answer_5-3-18.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
N = int(input())
2-
print("10"*N+"1")
2+
print("1"+"01"*N)

code/answer_5-3-19.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
N = input()
2-
print(N*int(N))
1+
N = int(input())
2+
print("10"*N+"1")

code/answer_5-3-20.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
N = int(input())
2-
print(str(N)*N)
1+
N = input()
2+
print(N*int(N))

0 commit comments

Comments
 (0)