Pagini recente » Diferente pentru problema/ambuscada intre reviziile 11 si 10 | Diferente pentru problema/arborest intre reviziile 6 si 5 | Diferente pentru problema/nucleulvaloros intre reviziile 3 si 7 | Monitorul de evaluare | Diferente pentru blog/meet-in-the-middle intre reviziile 66 si 65
Nu exista diferente intre titluri.
Diferente intre continut:
h2. 4sum
bq. Given A, an array of integers, find out if there are any four numbers such that their sum equals zero (you can use the same number more than once). For example given A = [2, 3, 1, 0, -4, -1] a solution is 3 + 1 + 0 - 4 = 0 or 0 + 0 + 0 + 0 = 0.
bq. Given A, an array of integers, find out if there are any four numbers such that their sum equals zero. For example given A = [2, 3, 1, 0, -4, -1] a solution is 3 + 1 + 0 - 4 = 0 or 0 + 0 + 0 + 0 = 0 (you can use the same number more than once).
The naive algorithm tries all the possible combinations of four numbers. This solution takes $O(N^4^)$ time.
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.