Skip to content

Commit b55c419

Browse files
add code
1 parent 6684faa commit b55c419

File tree

862 files changed

+3129
-0
lines changed

Some content is hidden

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

862 files changed

+3129
-0
lines changed

Diff for: code/answer_1-1-1.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
S = input()
2+
print(*S)

Diff for: code/answer_1-3-1.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(B, A)

Diff for: code/answer_1-3-2.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
X, Y, Z = map(int, input().split())
2+
print(Z, X, Y)

Diff for: code/answer_1-3-3.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = input().split()
2+
print(B, A)

Diff for: code/answer_1-3-4.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
X, Y, Z = input().split()
2+
print(Z, X, Y)

Diff for: code/answer_1-3-5.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
s1, s2, s3 = input().split(",")
2+
print(s1, s2, s3)

Diff for: code/answer_1-3-6.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
S, T = input().split()
2+
print(S, "san")

Diff for: code/answer_2-2-1.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
H1 = int(input())
2+
H2 = int(input())
3+
print(H1-H2)

Diff for: code/answer_2-2-10.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(A*B)

Diff for: code/answer_2-2-11.py

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

Diff for: code/answer_2-2-12.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
a, b = map(int, input().split())
2+
c, d = map(int, input().split())
3+
print(a*d-b*c)

Diff for: code/answer_2-2-13.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
a, b, c, d = map(int, input().split())
2+
print((a+b)*(c-d))
3+
print("Takahashi")

Diff for: code/answer_2-2-14.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
R = int(input())
2+
print(2*3.14*R)

Diff for: code/answer_2-2-15.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B, C = map(int, input().split())
2+
print(2*(A*B+B*C+C*A))

Diff for: code/answer_2-2-16.py

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

Diff for: code/answer_2-2-17.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
n, m = map(int, input().split())
2+
print((n-1)*(m-1))

Diff for: code/answer_2-2-18.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(A*B-(A+B-1))

Diff for: code/answer_2-2-19.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
H, W = map(int, input().split())
2+
h, w = map(int, input().split())
3+
print((H-h)*(W-w))

Diff for: code/answer_2-2-2.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N, A, B = map(int, input().split())
2+
print(N-A+B)

Diff for: code/answer_2-2-20.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
R = int(input())
2+
G = int(input())
3+
print(2*G-R)

Diff for: code/answer_2-2-21.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print((2*A+100)-B)

Diff for: code/answer_2-2-22.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import math
2+
N = int(input())
3+
print(math.factorial(N))

Diff for: code/answer_2-2-23.py

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

Diff for: code/answer_2-2-24.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(A**B)

Diff for: code/answer_2-2-25.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(A**B+B**A)

Diff for: code/answer_2-2-26.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
a = int(input())
2+
print(a+a**2+a**3)

Diff for: code/answer_2-2-27.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
r = int(input())
2+
print(3*(r**2))

Diff for: code/answer_2-2-28.py

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

Diff for: code/answer_2-2-29.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(32**(A-B))

Diff for: code/answer_2-2-3.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
n = int(input())
2+
print(n-1)

Diff for: code/answer_2-2-30.py

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

Diff for: code/answer_2-2-31.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
H = int(input())
2+
print((H*(12800000+H))**(1/2))

Diff for: code/answer_2-2-32.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
H = int(input())
2+
print((H*(12800000+H))**0.5)

Diff for: code/answer_2-2-33.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
D = int(input())
2+
print(D/100)

Diff for: code/answer_2-2-34.py

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

Diff for: code/answer_2-2-35.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
T, X = map(int, input().split())
2+
print(T/X)

Diff for: code/answer_2-2-36.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(A*B/100)

Diff for: code/answer_2-2-37.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print((1-B/A)*100)

Diff for: code/answer_2-2-38.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
AB, BC, CA = map(int, input().split())
2+
print(AB*BC//2)

Diff for: code/answer_2-2-39.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
a, b, h = [int(input()) for i in range(3)]
2+
print((a+b)*h//2)

Diff for: code/answer_2-2-4.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
M = int(input())
2+
print(48-M)

Diff for: code/answer_2-2-40.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
X, Y = map(int, input().split())
2+
print(X+Y//2)

Diff for: code/answer_2-2-41.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
s1, e1 = map(int, input().split())
2+
s2, e2 = map(int, input().split())
3+
s3, e3 = map(int, input().split())
4+
print((s1*e1+s2*e2+s3*e3)//10)

Diff for: code/answer_2-2-42.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N = int(input())
2+
print(N*800-N//15*200)

Diff for: code/answer_2-2-43.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N = int(input())
2+
print((N+99)//100)

Diff for: code/answer_2-2-44.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N, W = map(int, input().split())
2+
print(N//W)

Diff for: code/answer_2-2-45.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
x, y = map(int, input().split())
2+
print(y//x)

Diff for: code/answer_2-2-46.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N = int(input())
2+
print(N//3)

Diff for: code/answer_2-2-47.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, P = map(int, input().split())
2+
print((3*A+P)//2)

Diff for: code/answer_2-2-48.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
X = int(input())
2+
print(X//10)

Diff for: code/answer_2-2-49.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import math
2+
a, b = map(int, input().split())
3+
print(math.ceil((a+b)/2))

Diff for: code/answer_2-2-5.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
S, T = map(int, input().split())
2+
print(T-S+1)

Diff for: code/answer_2-2-50.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import math
2+
N = int(input())
3+
print(math.ceil(N/2))

Diff for: code/answer_2-2-51.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import math
2+
N = int(input())
3+
print(math.ceil(N/2))

Diff for: code/answer_2-2-52.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import math
2+
A, B = map(int, input().split())
3+
print(math.ceil(B/A))

Diff for: code/answer_2-2-53.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N = int(input())
2+
print((N % 12)+1)

Diff for: code/answer_2-2-54.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print((A+B) % 24)

Diff for: code/answer_2-2-55.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
X, A, B = [int(input()) for i in range(3)]
2+
print((X-A) % B)

Diff for: code/answer_2-2-56.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
X = int(input())
2+
print(100-(X % 100))

Diff for: code/answer_2-2-57.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
R = int(input())
2+
print(100-(R % 100))

Diff for: code/answer_2-2-58.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N, K, A = map(int, input().split())
2+
print(((A+K-2) % N)+1)

Diff for: code/answer_2-2-59.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B, C = map(int, input().split())
2+
print((A*B*C) % (10**9+7))

Diff for: code/answer_2-2-6.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N, i = map(int, input().split())
2+
print(N-i+1)

Diff for: code/answer_2-2-60.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
N = int(input())
2+
print(N % 998244353)

Diff for: code/answer_2-2-7.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
a, b, c = map(int, input().split())
2+
print(21-(a+b+c))

Diff for: code/answer_2-2-8.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
a, b = map(int, input().split())
2+
c, d = map(int, input().split())
3+
print(b-c)

Diff for: code/answer_2-2-9.py

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

Diff for: code/answer_2-6-1.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
a, b = map(int, input().split())
2+
print(a | b)

Diff for: code/answer_2-6-2.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B, C = map(int, input().split())
2+
print(A ^ B ^ C)

Diff for: code/answer_2-6-3.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
l1, l2, l3 = map(int, input().split())
2+
print(l1 ^ l2 ^ l3)

Diff for: code/answer_2-6-4.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
x1, y1 = map(int, input().split())
2+
x2, y2 = map(int, input().split())
3+
x3, y3 = map(int, input().split())
4+
print(x1 ^ x2 ^ x3, y1 ^ y2 ^ y3)

Diff for: code/answer_2-6-5.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
A = int(input())
2+
B = int(input())
3+
print(A ^ B)

Diff for: code/answer_2-6-6.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A, B = map(int, input().split())
2+
print(A ^ B)

Diff for: code/answer_3-1-1.py

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

Diff for: code/answer_3-1-2.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
X, Y, Z = map(int, input().split())
2+
A, B, C = X, Y, Z
3+
A, B = B, A
4+
A, C = C, A
5+
print(A, B, C)

Diff for: code/answer_3-1-3.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
X, Y, Z = map(int, input().split())
2+
A, B, C = X, Y, Z
3+
A, B, C = C, A, B
4+
print(A, B, C)

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

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

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

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +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")

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

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
X = input()
2+
if X in "753":
3+
print("YES")
4+
else:
5+
print("NO")

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

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

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

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

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

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
N = input()
2+
if N in "369":
3+
print("YES")
4+
else:
5+
print("NO")

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

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

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

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

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

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

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

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

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

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

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

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
A, B = input().split()
2+
if "2" in A or "2" in B:
3+
print("No")
4+
else:
5+
print("Yes")

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

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

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

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
AB = input()
2+
if "2" in AB:
3+
print("No")
4+
else:
5+
print("Yes")

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

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

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

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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:
6+
print("No")

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

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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:
5+
print("Yes")
6+
else:
7+
print("No")

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

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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:
6+
print("No")

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

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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:
5+
print("Yes")
6+
else:
7+
print("No")

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

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
A, B, C = map(int, input().split())
2+
if A <= C <= B:
3+
print("Yes")
4+
else:
5+
print("No")

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

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
N = int(input())
2+
if -2**31 <= N < 2**31:
3+
print("Yes")
4+
else:
5+
print("No")

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

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
X, Y = map(int, input().split())
2+
if -3 <= Y-X <= 2:
3+
print("Yes")
4+
else:
5+
print("No")

0 commit comments

Comments
 (0)