Editorial for Min 4 số
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Spoiler Alert
Hint 1
-
Kiểm tra xem nếu \(a\) có nhỏ nhất hay không (không lớn hơn tất cả số trong \(b, c, d\)) thì xuất \(a\). Xét tương tự với các số \(b, c, d\)
-
Ngược lại xuất \(a\) vì lúc này \(a = b = c = d\)
Hint 2
-
Gọi \(min(a, b)\) là số nhỏ nhất trong 2 số \(a\) và \(b\)
-
\(min(a, b, c, d) = min(min(a, b), min(c, d))\)
-
\(min(a, b, c) = min(min(a, b), c) = min(min(b, c), a) = min(min(c, a), b)\)
-
\(min(a, b) = a\) khi \(a \leq b\)
-
\(min(a, b) = b\) khi \(a \geq b\)
Comments