

Vũ Gia Bình
Giới thiệu về bản thân



































def tim_doi_chan_diem(n, m, diem_cac_doi):
"""
Tìm số thứ tự của các đội có tổng điểm chẵn.
Args:
n: Số học sinh trong mỗi đội.
m: Số đội chơi.
diem_cac_doi: Danh sách các dãy điểm của từng đội.
Returns:
Danh sách số thứ tự của các đội có tổng điểm chẵn.
"""
doi_chan_diem = []
for i in range(m):
tong_diem = sum(diem_cac_doi[i])
if tong_diem % 2 == 0:
doi_chan_diem.append(i + 1)
return doi_chan_diem
if __name__ == "__main__":
# Đọc dữ liệu đầu vào
n, m = map(int, input().split())
diem_cac_doi = []
for _ in range(m):
diem_doi = list(map(int, input().split()))
diem_cac_doi.append(diem_doi)
# Tìm các đội có tổng điểm chẵn
cac_doi_chan_diem = tim_doi_chan_diem(n, m, diem_cac_doi)
# In kết quả
for doi in cac_doi_chan_diem:
print(doi, end=" ")
def generate_sequence(n):
"""Generates the sequence A up to the nth term."""
if n < 0:
return "Please enter a non-negative number."
sequence = [] # This list will hold our sequence
if n >= 0:
sequence.append(1) # A[0] = 1
if n >= 1:
sequence.append(3) # A[1] = 3
for i in range(2, n + 1):
# Calculate A[i] using the rule: A[i] = A[i-1] * 2 * A[i-2]
next_term = sequence[i - 1] * 2 * sequence[i - 2]
sequence.append(next_term)
return sequence
# Let's see the sequence up to the 5th term (A[0] to A[5])
result = generate_sequence(5)
print(result) # Output: [1, 3, 6, 36, 432, 31104]
def generate_sequence(n):
"""Generates the sequence A up to the nth term."""
if n < 0:
return "Please enter a non-negative number."
sequence = [] # This list will hold our sequence
if n >= 0:
sequence.append(1) # A[0] = 1
if n >= 1:
sequence.append(3) # A[1] = 3
for i in range(2, n + 1):
# Calculate A[i] using the rule: A[i] = A[i-1] * 2 * A[i-2]
next_term = sequence[i - 1] * 2 * sequence[i - 2]
sequence.append(next_term)
return sequence
# Let's see the sequence up to the 5th term (A[0] to A[5])
result = generate_sequence(5)
print(result) # Output: [1, 3, 6, 36, 432, 31104]
# Initialize a 2D array with zeros a = [[0 for _ in range(n)] for _ in range(n)]
# Print the 2D array for row in a: print(" ".join(map(str, row)))