Skip to content

Commit 04ac780

Browse files
Merge pull request #52 from KoyanagiHitoshi/dev
Dev
2 parents 591b5ed + 461d446 commit 04ac780

File tree

218 files changed

+902
-860
lines changed

Some content is hidden

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

218 files changed

+902
-860
lines changed

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## [v3.31.0](https://github.com/KoyanagiHitoshi/AtCoder-Python-Introduction/releases/tag/v3.31.0) / 2025-02-23
4+
5+
* [#52](https://github.com/KoyanagiHitoshi/AtCoder-Python-Introduction/pull/52) add code
6+
* [#52](https://github.com/KoyanagiHitoshi/AtCoder-Python-Introduction/pull/52) update CHANGELOG.md
7+
38
## [v3.30.0](https://github.com/KoyanagiHitoshi/AtCoder-Python-Introduction/releases/tag/v3.30.0) / 2025-01-26
49

510
* [#51](https://github.com/KoyanagiHitoshi/AtCoder-Python-Introduction/pull/51) add code

Diff for: code/answer_4-1-10.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
a, b = input().split()
2-
if a == "H" and b == "H":
3-
print("H")
4-
if a == "H" and b == "D":
5-
print("D")
6-
if a == "D" and b == "H":
7-
print("D")
8-
if a == "D" and b == "D":
9-
print("H")
1+
t, a = input().split()
2+
if t == "sick" and a == "sick":
3+
print(1)
4+
if t == "sick" and a == "fine":
5+
print(2)
6+
if t == "fine" and a == "sick":
7+
print(3)
8+
if t == "fine" and a == "fine":
9+
print(4)

Diff for: code/answer_4-1-100.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a, b, c, d, e, f = input()
2-
if c == d and e == f:
1+
S, T = input().split()
2+
if S < T:
33
print("Yes")
44
else:
55
print("No")

Diff for: code/answer_4-1-101.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a, b, c = input()
2-
if a == c:
3-
print("Yes")
1+
S = input()
2+
if S <= "2019/04/30":
3+
print("Heisei")
44
else:
5-
print("No")
5+
print("TBD")

Diff for: code/answer_4-1-102.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
AB, AC, BC = input().split()
2-
if (AB == ">" and AC == "<") or (AC == ">" and AB == "<"):
3-
print("A")
4-
elif (AB == "<" and BC == "<") or (BC == ">" and AB == ">"):
5-
print("B")
1+
S, T = input().split()
2+
A, B = map(int, input().split())
3+
U = input()
4+
if S == U:
5+
print(A-1, B)
66
else:
7-
print("C")
7+
print(A, B-1)

Diff for: code/answer_4-1-103.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
a, b = input().split()
2-
if a == "H" and b == "H":
3-
print("H")
4-
elif a == "H" and b == "D":
5-
print("D")
6-
elif a == "D" and b == "H":
7-
print("D")
1+
a, b, c, d, e, f = input()
2+
if c == d and e == f:
3+
print("Yes")
84
else:
9-
print("H")
5+
print("No")

Diff for: code/answer_4-1-104.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
S1 = input()
2-
S2 = input()
3-
if (S1 == "#." and S2 == ".#") or (S1 == ".#" and S2 == "#."):
4-
print("No")
5-
else:
1+
a, b, c = input()
2+
if a == c:
63
print("Yes")
4+
else:
5+
print("No")

Diff for: code/answer_4-1-105.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
c = input()
2-
if c in "aiueo":
3-
print("vowel")
1+
AB, AC, BC = input().split()
2+
if (AB == ">" and AC == "<") or (AC == ">" and AB == "<"):
3+
print("A")
4+
elif (AB == "<" and BC == "<") or (BC == ">" and AB == ">"):
5+
print("B")
46
else:
5-
print("consonant")
7+
print("C")

Diff for: code/answer_4-1-106.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
X = input()
2-
if X in "753":
3-
print("YES")
1+
a, b = input().split()
2+
if a == "H" and b == "H":
3+
print("H")
4+
elif a == "H" and b == "D":
5+
print("D")
6+
elif a == "D" and b == "H":
7+
print("D")
48
else:
5-
print("NO")
9+
print("H")

Diff for: code/answer_4-1-107.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
N = input()
2-
if "7" in N:
3-
print("Yes")
4-
else:
1+
S1 = input()
2+
S2 = input()
3+
if (S1 == "#." and S2 == ".#") or (S1 == ".#" and S2 == "#."):
54
print("No")
5+
else:
6+
print("Yes")

Diff for: code/answer_4-1-108.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
N = input()
2-
if "9" in N:
3-
print("Yes")
1+
c = input()
2+
if c in "aiueo":
3+
print("vowel")
44
else:
5-
print("No")
5+
print("consonant")

Diff for: code/answer_4-1-109.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
N = input()
2-
if N in "369":
1+
X = input()
2+
if X in "753":
33
print("YES")
44
else:
55
print("NO")

Diff for: code/answer_4-1-11.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
Q = int(input())
2-
if Q == 1:
3-
print("ABC")
4-
else:
5-
print("chokudai")
1+
a, b = input().split()
2+
if a == "H" and b == "H":
3+
print("H")
4+
if a == "H" and b == "D":
5+
print("D")
6+
if a == "D" and b == "H":
7+
print("D")
8+
if a == "D" and b == "D":
9+
print("H")

Diff for: code/answer_4-1-110.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a = input()
2-
if a in "abcdefghijklmnopqrstuvwxyz":
3-
print("a")
1+
N = input()
2+
if "7" in N:
3+
print("Yes")
44
else:
5-
print("A")
5+
print("No")

Diff for: code/answer_4-1-111.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a = input()
2-
if a in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
3-
print("A")
1+
N = input()
2+
if "9" in N:
3+
print("Yes")
44
else:
5-
print("a")
5+
print("No")

Diff for: code/answer_4-1-112.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
N = int(input())
2-
S = input()
3-
if "ab" in S or "ba" in S:
4-
print("Yes")
1+
N = input()
2+
if N in "369":
3+
print("YES")
54
else:
6-
print("No")
5+
print("NO")

Diff for: code/answer_4-1-113.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
N = int(input())
2-
S = input()
3-
if "o" in S and "x" not in S:
4-
print("Yes")
1+
a = input()
2+
if a in "abcdefghijklmnopqrstuvwxyz":
3+
print("a")
54
else:
6-
print("No")
5+
print("A")

Diff for: code/answer_4-1-114.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
N = int(input())
2-
S = input()
3-
if "MM" in S or "FF" in S:
4-
print("No")
1+
a = input()
2+
if a in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
3+
print("A")
54
else:
6-
print("Yes")
5+
print("a")

Diff for: code/answer_4-1-115.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
A, B = input().split()
2-
if "2" in A or "2" in B:
3-
print("No")
4-
else:
1+
N = int(input())
2+
S = input()
3+
if "ab" in S or "ba" in S:
54
print("Yes")
5+
else:
6+
print("No")

Diff for: code/answer_4-1-116.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
AB = input()
2-
if "2" in AB:
3-
print("No")
4-
else:
1+
N = int(input())
2+
S = input()
3+
if "o" in S and "x" not in S:
54
print("Yes")
5+
else:
6+
print("No")

Diff for: code/answer_4-1-117.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
N = int(input())
12
S = input()
2-
if S in ["ACE", "BDF", "CEG", "DFA", "EGB", "FAC", "GBD"]:
3-
print("Yes")
4-
else:
3+
if "MM" in S or "FF" in S:
54
print("No")
5+
else:
6+
print("Yes")

Diff for: code/answer_4-1-118.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
S = input()
2-
if S in ["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]:
3-
print("Yes")
4-
else:
1+
A, B = input().split()
2+
if "2" in A or "2" in B:
53
print("No")
4+
else:
5+
print("Yes")

Diff for: code/answer_4-1-119.py

+4-5
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:
4-
print("Yes")
5-
else:
1+
AB = input()
2+
if "2" in AB:
63
print("No")
4+
else:
5+
print("Yes")

Diff for: code/answer_4-1-12.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
x = int(input())
2-
if x == 0:
3-
print(1)
1+
Q = int(input())
2+
if Q == 1:
3+
print("ABC")
44
else:
5-
print(0)
5+
print("chokudai")

Diff for: code/answer_4-1-120.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
A = list(map(int, input().split()))
2-
if A in [[2, 1, 3, 4, 5], [1, 3, 2, 4, 5], [1, 2, 4, 3, 5], [1, 2, 3, 5, 4]]:
1+
S = input()
2+
if S in ["ACE", "BDF", "CEG", "DFA", "EGB", "FAC", "GBD"]:
33
print("Yes")
44
else:
55
print("No")

Diff for: code/answer_4-1-121.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
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+
S = input()
2+
if S in ["ABC", "ACB", "BAC", "BCA", "CAB", "CBA"]:
53
print("Yes")
64
else:
75
print("No")

Diff for: code/answer_4-1-122.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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:
2+
X = [[1, 2], [2, 3], [4, 5], [5, 6], [7, 8], [8, 9]]
3+
if [A, B] in X:
44
print("Yes")
55
else:
66
print("No")

Diff for: code/answer_4-1-123.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
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 = list(map(int, input().split()))
2+
if A in [[2, 1, 3, 4, 5], [1, 3, 2, 4, 5], [1, 2, 4, 3, 5], [1, 2, 3, 5, 4]]:
53
print("Yes")
64
else:
75
print("No")

Diff for: code/answer_4-1-124.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")

Diff for: code/answer_4-1-125.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
N = int(input())
2-
if -2**31 <= N < 2**31:
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:
34
print("Yes")
45
else:
56
print("No")

Diff for: code/answer_4-1-126.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
X, Y = map(int, input().split())
2-
if -3 <= Y-X <= 2:
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")

Diff for: code/answer_4-1-127.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+
A, B, C = map(int, input().split())
2+
if A <= C <= B:
33
print("Yes")
44
else:
55
print("No")

Diff for: code/answer_4-1-128.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+
N = int(input())
2+
if -2**31 <= N < 2**31:
33
print("Yes")
44
else:
55
print("No")

Diff for: code/answer_4-1-129.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+
X, Y = map(int, input().split())
2+
if -3 <= Y-X <= 2:
3+
print("Yes")
84
else:
9-
print("expert")
5+
print("No")

Diff for: code/answer_4-1-13.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
x = int(input())
2-
if x < 1200:
3-
print("ABC")
2+
if x == 0:
3+
print(1)
44
else:
5-
print("ARC")
5+
print(0)

Diff for: code/answer_4-1-130.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
a, b, c, d = map(int, input())
2-
if a == b == c or b == c == d:
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")

Diff for: code/answer_4-1-131.py

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

0 commit comments

Comments
 (0)