Afişează mesaje
Pagini: [1]
1  Comunitate - feedback, proiecte si distractie / Blog / Răspuns: Problem: Resource hog : Ianuarie 08, 2016, 14:53:59
Can quantity also be negative? Because in case it is positive we can just simply use a map (hash table) and update the max when a new update comes along.
2  infoarena - concursuri, probleme, evaluator, articole / Arhiva educationala / Răspuns: 054 Problema Damelor : Noiembrie 16, 2014, 23:36:14
Are cineva un exemplu in Java care ruleaza pentru ultimul test?
3  infoarena - concursuri, probleme, evaluator, articole / Infoarena Monthly 2014 / Răspuns: Infoarena Monthly 2014, Runda 7 : Iulie 31, 2014, 22:44:05
La prima problema eu m-am gandit in felul urmator: In fiecare pozitie trebuie sa avem unul din cele m numere. Un numar oarecare X pe pozitia aia o sa apara de M^(N-1) ori pentru ca pe ficeare din celelalte pozitii pot sa pun orice. Asta ii adevarat pentru fiecare numar => pentru suma de pe o pozitie avem SUM *N^(M-1). Din cauza ca avem N pozitii in total, formula va fi: N * SUM * N^(M-1). (SUM -reprezinta suma tuturor numerelor) Ma puteti ajuta va rog ce gresesc in formula aceasta si la cum am ajuns la ea? Trec 2 teste dar celelalte nu.
4  Comunitate - feedback, proiecte si distractie / Blog / Răspuns: Probability shortlist : Iulie 04, 2014, 10:47:12
Yes, I see, you are right. The radius should be generated proportionally to the number of points at that radius. Actually there is another solution to this problem as well but it is less efficient. It can be solved in a Monte Carlo simulation manner. Just generate x between 0 and R, generate y between 0 and R and if it is within a distance smaller than R with respect to the center of the circle return it. It rejects the points outside the circle but I think it does work.
5  Comunitate - feedback, proiecte si distractie / Blog / Răspuns: Probability shortlist : Iulie 03, 2014, 20:05:09
Problem number 3 can be done by using polar coordinates. Generate a value for r in the range [0, R] and generate another value theta in the range (0, 360). After obtaining these one can get the euclidean coordinates using some trigonomoetric functions. Check out Wikipedia for the details. e.g. for the first quadrant: x = sin(theta) * r; y = cos(theta) * r
Pagini: [1]
Powered by SMF 1.1.19 | SMF © 2006-2013, Simple Machines