Cho một dãy nhị phân gồm 10 bit, được đánh số từ 1 đến 10. Gọi bit_i là bit thứ i. Ở bài toán này, công việc của bạn rất đơn giản, đó là hãy tính:
f(bit_1, bit_2, bit_3, bit_4, bit_5, bit_6, bit_7, bit_8, bit_9, bit_10)
Biết rằng
f(bit_1, bit_2, bit_3, bit_4, bit_5, bit_6, bit_7, bit_8, bit_9, bit_10)
=
(bit_1 ∨ bit_2) ⊕ (bit_1 ∨ bit_3) ⊕ (bit_1 ∨ bit_4) ⊕ (bit_1 ∨ bit_5) ⊕ (bit_1 ∨ bit_6) ⊕ (bit_1 ∨ bit_7) ⊕ (bit_1 ∨ bit_8) ⊕ (bit_1 ∨ bit_9) ⊕ (bit_1 ∨ bit_10) ⊕ (bit_2 ∨ bit_3) ⊕ (bit_2 ∨ bit_4) ⊕ (bit_2 ∨ bit_5) ⊕ (bit_2 ∨ bit_6) ⊕ (bit_2 ∨ bit_7) ⊕ (bit_2 ∨ bit_8) ⊕ (bit_2 ∨ bit_9) ⊕ (bit_2 ∨ bit_10) ⊕ (bit_3 ∨ bit_4) ⊕ (bit_3 ∨ bit_5) ⊕ (bit_3 ∨ bit_6) ⊕ (bit_3 ∨ bit_7) ⊕ (bit_3 ∨ bit_8) ⊕ (bit_3 ∨ bit_9) ⊕ (bit_3 ∨ bit_10) ⊕ (bit_4 ∨ bit_5) ⊕ (bit_4 ∨ bit_6) ⊕ (bit_4 ∨ bit_7) ⊕ (bit_4 ∨ bit_8) ⊕ (bit_4 ∨ bit_9) ⊕ (bit_4 ∨ bit_10) ⊕ (bit_5 ∨ bit_6) ⊕ (bit_5 ∨ bit_7) ⊕ (bit_5 ∨ bit_8) ⊕ (bit_5 ∨ bit_9) ⊕ (bit_5 ∨ bit_10) ⊕ (bit_6 ∨ bit_7) ⊕ (bit_6 ∨ bit_8) ⊕ (bit_6 ∨ bit_9) ⊕ (bit_6 ∨ bit_10) ⊕ (bit_7 ∨ bit_8) ⊕ (bit_7 ∨ bit_9) ⊕ (bit_7 ∨ bit_10) ⊕ (bit_8 ∨ bit_9) ⊕ (bit_8 ∨ bit_10) ⊕ (bit_9 ∨ bit_10) ⊕ (bit_1 ∨ bit_2 ∨ bit_3) ⊕ (bit_1 ∨ bit_2 ∨ bit_4) ⊕ (bit_1 ∨ bit_2 ∨ bit_5) ⊕ (bit_1 ∨ bit_2 ∨ bit_6) ⊕ (bit_1 ∨ bit_2 ∨ bit_7) ⊕ (bit_1 ∨ bit_2 ∨ bit_8) ⊕ (bit_1 ∨ bit_2 ∨ bit_9) ⊕ (bit_1 ∨ bit_2 ∨ bit_10) ⊕ (bit_1 ∨ bit_3 ∨ bit_4) ⊕ (bit_1 ∨ bit_3 ∨ bit_5) ⊕ (bit_1 ∨ bit_3 ∨ bit_6) ⊕ (bit_1 ∨ bit_3 ∨ bit_7) ⊕ (bit_1 ∨ bit_3 ∨ bit_8) ⊕ (bit_1 ∨ bit_3 ∨ bit_9) ⊕ (bit_1 ∨ bit_3 ∨ bit_10) ⊕ (bit_1 ∨ bit_4 ∨ bit_5) ⊕ (bit_1 ∨ bit_4 ∨ bit_6) ⊕ (bit_1 ∨ bit_4 ∨ bit_7) ⊕ (bit_1 ∨ bit_4 ∨ bit_8) ⊕ (bit_1 ∨ bit_4 ∨ bit_9) ⊕ (bit_1 ∨ bit_4 ∨ bit_10) ⊕ (bit_1 ∨ bit_5 ∨ bit_6) ⊕ (bit_1 ∨ bit_5 ∨ bit_7) ⊕ (bit_1 ∨ bit_5 ∨ bit_8) ⊕ (bit_1 ∨ bit_5 ∨ bit_9) ⊕ (bit_1 ∨ bit_5 ∨ bit_10) ⊕ (bit_1 ∨ bit_6 ∨ bit_7) ⊕ (bit_1 ∨ bit_6 ∨ bit_8) ⊕ (bit_1 ∨ bit_6 ∨ bit_9) ⊕ (bit_1 ∨ bit_6 ∨ bit_10) ⊕ (bit_1 ∨ bit_7 ∨ bit_8) ⊕ (bit_1 ∨ bit_7 ∨ bit_9) ⊕ (bit_1 ∨ bit_7 ∨ bit_10) ⊕ (bit_1 ∨ bit_8 ∨ bit_9) ⊕ (bit_1 ∨ bit_8 ∨ bit_10) ⊕ (bit_1 ∨ bit_9 ∨ bit_10) ⊕ (bit_2 ∨ bit_3 ∨ bit_4) ⊕ (bit_2 ∨ bit_3 ∨ bit_5) ⊕ (bit_2 ∨ bit_3 ∨ bit_6) ⊕ (bit_2 ∨ bit_3 ∨ bit_7) ⊕ (bit_2 ∨ bit_3 ∨ bit_8) ⊕ (bit_2 ∨ bit_3 ∨ bit_9) ⊕ (bit_2 ∨ bit_3 ∨ bit_10) ⊕ (bit_2 ∨ bit_4 ∨ bit_5) ⊕ (bit_2 ∨ bit_4 ∨ bit_6) ⊕ (bit_2 ∨ bit_4 ∨ bit_7) ⊕ (bit_2 ∨ bit_4 ∨ bit_8) ⊕ (bit_2 ∨ bit_4 ∨ bit_9) ⊕ (bit_2 ∨ bit_4 ∨ bit_10) ⊕ (bit_2 ∨ bit_5 ∨ bit_6) ⊕ (bit_2 ∨ bit_5 ∨ bit_7) ⊕ (bit_2 ∨ bit_5 ∨ bit_8) ⊕ (bit_2 ∨ bit_5 ∨ bit_9) ⊕ (bit_2 ∨ bit_5 ∨ bit_10) ⊕ (bit_2 ∨ bit_6 ∨ bit_7) ⊕ (bit_2 ∨ bit_6 ∨ bit_8) ⊕ (bit_2 ∨ bit_6 ∨ bit_9) ⊕ (bit_2 ∨ bit_6 ∨ bit_10) ⊕ (bit_2 ∨ bit_7 ∨ bit_8) ⊕ (bit_2 ∨ bit_7 ∨ bit_9) ⊕ (bit_2 ∨ bit_7 ∨ bit_10) ⊕ (bit_2 ∨ bit_8 ∨ bit_9) ⊕ (bit_2 ∨ bit_8 ∨ bit_10) ⊕ (bit_2 ∨ bit_9 ∨ bit_10) ⊕ (bit_3 ∨ bit_4 ∨ bit_5) ⊕ (bit_3 ∨ bit_4 ∨ bit_6) ⊕ (bit_3 ∨ bit_4 ∨ bit_7) ⊕ (bit_3 ∨ bit_4 ∨ bit_8) ⊕ (bit_3 ∨ bit_4 ∨ bit_9) ⊕ (bit_3 ∨ bit_4 ∨ bit_10) ⊕ (bit_3 ∨ bit_5 ∨ bit_6) ⊕ (bit_3 ∨ bit_5 ∨ bit_7) ⊕ (bit_3 ∨ bit_5 ∨ bit_8) ⊕ (bit_3 ∨ bit_5 ∨ bit_9) ⊕ (bit_3 ∨ bit_5 ∨ bit_10) ⊕ (bit_3 ∨ bit_6 ∨ bit_7) ⊕ (bit_3 ∨ bit_6 ∨ bit_8) ⊕ (bit_3 ∨ bit_6 ∨ bit_9) ⊕ (bit_3 ∨ bit_6 ∨ bit_10) ⊕ (bit_3 ∨ bit_7 ∨ bit_8) ⊕ (bit_3 ∨ bit_7 ∨ bit_9) ⊕ (bit_3 ∨ bit_7 ∨ bit_10) ⊕ (bit_3 ∨ bit_8 ∨ bit_9) ⊕ (bit_3 ∨ bit_8 ∨ bit_10) ⊕ (bit_3 ∨ bit_9 ∨ bit_10) ⊕ (bit_4 ∨ bit_5 ∨ bit_6) ⊕ (bit_4 ∨ bit_5 ∨ bit_7) ⊕ (bit_4 ∨ bit_5 ∨ bit_8) ⊕ (bit_4 ∨ bit_5 ∨ bit_9) ⊕ (bit_4 ∨ bit_5 ∨ bit_10) ⊕ (bit_4 ∨ bit_6 ∨ bit_7) ⊕ (bit_4 ∨ bit_6 ∨ bit_8) ⊕ (bit_4 ∨ bit_6 ∨ bit_9) ⊕ (bit_4 ∨ bit_6 ∨ bit_10) ⊕ (bit_4 ∨ bit_7 ∨ bit_8) ⊕ (bit_4 ∨ bit_7 ∨ bit_9) ⊕ (bit_4 ∨ bit_7 ∨ bit_10) ⊕ (bit_4 ∨ bit_8 ∨ bit_9) ⊕ (bit_4 ∨ bit_8 ∨ bit_10) ⊕ (bit_4 ∨ bit_9 ∨ bit_10) ⊕ (bit_5 ∨ bit_6 ∨ bit_7) ⊕ (bit_5 ∨ bit_6 ∨ bit_8) ⊕ (bit_5 ∨ bit_6 ∨ bit_9) ⊕ (bit_5 ∨ bit_6 ∨ bit_10) ⊕ (bit_5 ∨ bit_7 ∨ bit_8) ⊕ (bit_5 ∨ bit_7 ∨ bit_9) ⊕ (bit_5 ∨ bit_7 ∨ bit_10) ⊕ (bit_5 ∨ bit_8 ∨ bit_9) ⊕ (bit_5 ∨ bit_8 ∨ bit_10) ⊕ (bit_5 ∨ bit_9 ∨ bit_10) ⊕ (bit_6 ∨ bit_7 ∨ bit_8) ⊕ (bit_6 ∨ bit_7 ∨ bit_9) ⊕ (bit_6 ∨ bit_7 ∨ bit_10) ⊕ (bit_6 ∨ bit_8 ∨ bit_9) ⊕ (bit_6 ∨ bit_8 ∨ bit_10) ⊕ (bit_6 ∨ bit_9 ∨ bit_10) ⊕ (bit_7 ∨ bit_8 ∨ bit_9) ⊕ (bit_7 ∨ bit_8 ∨ bit_10) ⊕ (bit_7 ∨ bit_9 ∨ bit_10) ⊕ (bit_8 ∨ bit_9 ∨ bit_10)
Trong đó ⊕ tương ứng với phép XOR và ∨ tương ứng với phép OR
Bạn có thể đọc thêm về phép XOR và OR tại đây
Input
Gồm 10 số, mỗi số có giá trị 0 hoặc 1 tương ứng với 10 bit của dãy nhị phân
Output
Một dòng duy nhất là giá trị của f(bit_1, bit_2, bit_3, bit_4, bit_5, bit_6, bit_7, bit_8, bit_9, bit_10)