EZFORMULA - Tính toán đơn giản
Dữ liệu vào: standard input
Dữ liệu ra: standard output
Giới hạn thời gian: 1.0 giây
Giới hạn bộ nhớ: 128 megabyte
Đăng bởi: middlest

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 tương ứng với phép OR

Bạn có thể đọc thêm về phép XOROR 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)

Ví dụ

  • input
    0 1 1 0 0 0 0 0 0 0
    output
    1
Back to Top