I would petition to add a reasonable machine accuracy margin to the final large test. Out of 4000 elements, my result differed from the correct answer in 134 elements with a maximum difference of < 1E-12!! Especially when going to the effort of making a properly vectorized solution avoiding arrayfun() and other "cheats" for this strict problem.
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: United States.
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.