Show all threads Hide all threads Show all messages Hide all messages |
WA #20 | 👑OmegaLuL230👑 | 1648. Yachts | 17 Feb 2020 23:29 | 1 |
WA #20 👑OmegaLuL230👑 17 Feb 2020 23:29 Help pls, I have WA #20 can u give me a test? (all answers of my program on tests which i generated are right) |
What is the right answer for this test? | Hrayr[Goris N4 High School] | 1648. Yachts | 18 Feb 2012 04:55 | 2 |
20 6 1 10 1 2 35 4 7 6 15 4 1 10 7 9 4 3 5 12 1 20 is the answer 120 56 ? My AC program say: "120 58". |
Do you know a better Algorithm | lql1993 | 1648. Yachts | 27 Jun 2011 14:51 | 4 |
This is my program: [code deleted] I got AC,but I want to know a better algorithm which is shorter than my program. Thanks. Edited by author 02.12.2008 16:34 Edited by author 02.12.2008 16:34 Edited by moderator 26.01.2020 20:06 Comrade! I hope, everything is much better then you think :) This algorithm has O(N) complexity. Beter complexity is impossible, because you have to look every month record... Though, this algorithm is optimal... Edited by author 19.06.2011 19:24 Apply the GOOD JOB for College ACMers to Make Large Money and Become a Millionaire Hello, We need large no. of dedicated and hard working ACMers. The payment is good so we need ACMers to be efficient. All you have to do to get the job is to sign up at our websites. The link of our websites are given below. http://www.PaisaLive.com/register.asp?3556638-4847933 After the registration, a confirmation email will be sent to your specified email address. Please click on the link inside the confirmation email to activate your account and recieve ACM work instantly. For any other queries you can mail the administrator. Miss Juliet Admin paisalive.com |
What is a right algorithm to that problem? | Asyamov Igor | 1648. Yachts | 27 Aug 2010 20:27 | 16 |
Tell me please! Is it greedy??? Greedy only? I think. I don't solve else but think that next algo is right: 1. maximal production =d in all n periods; 2. Greedy approach :satisfy first demand as fully as possible; 3. If we have residue in last period equal to k diminish by k residues in previous periods until it is possible 4. Sum final residues along all periods. Edited by author 26.10.2008 20:52 My algo is the same as your! (but still wa 15) :-( You definitely need reading math eco theory optimal store managing(Taha a.s.o.) P.S.I also have WA14. First number of output I guarantee but the second need more delicate algo. may be your problem with the type of the second number(it should be __int64)??? * Maxim Dvoynishnikov (Dnipropetrovsk SU) 27 Oct 2008 01:32 I have WA49 with greedy and restroring. Re: * double 27 Oct 2008 06:17 use int64(long long) ,then you'll get AC. Yuare right! With __int 64 AC. I didn'r recognized masked danger:100000*100000=10*1-e9. All data seemed fitted in int type. Edited by author 27.10.2008 09:21 Are you got AC with your algo or you had chaged it??? Edited by author 28.10.2008 14:51 I considered stored values backward more attentievely according with alg: store[i-1]=max(store[i]+sell[i-1]-d,0) store[n]:=0; i=n..1 where sell[i-1] array of greedy selling on the first stage. Accepted!!!!!! this test help me find my bug... in: 5 5 3 1 20 3 10 out: 25 10 and now,after accepted, could somebody, who solved this problem with DP, sent to me your solution? my mail: asyamov@mail.ru Edited by author 28.10.2008 16:18 I think greedy can work well. I don'n understand, how to solve this problem whith DP or greedy. I solve with RMQ. |
WA #49 | Faeton (Kyiv - Mohyla Academy) | 1648. Yachts | 21 Jun 2010 17:05 | 3 |
WA #49 Faeton (Kyiv - Mohyla Academy) 9 Nov 2008 20:34 Could anyone give me some tricky tests? Strange: printf with %lld does not work for a long long, while cout does. |
WA9 | balandini | 1648. Yachts | 3 Nov 2009 14:03 | 1 |
WA9 balandini 3 Nov 2009 14:03 Edited by author 03.11.2009 14:05 Edited by author 01.02.2012 14:29 |
Give me some tests, please!!!! | Youth crew | 1648. Yachts | 25 Oct 2009 14:28 | 3 |
WA11.... WTFail?! My programm dont have bug on tests in this forum! Edited by author 08.10.2009 20:45 Edited by author 08.10.2009 20:45 in: 5 10 5 10 10 5 15 out: 45 20 it is lie!! in: 5 10 5 10 10 5 15 out: 45 5 |
Anti WA15 | derxyz | 1648. Yachts | 26 Mar 2009 13:51 | 1 |
this test help me find my bug... in: 4 5 3 1 7 9 out: 20 12 |
Problems !!! Help me!! WA #2 | De5 | 1648. Yachts | 22 Feb 2009 18:26 | 1 |
program verv; var a : array [1 .. 20000] of Integer; d, d2, min, k, n, i, j : Longint; begin k := 0; Readln (n, d); d2 := 0; for i := 1 to n do begin Read (a[i]); if ((d - a[i]) > 0) then begin min := d - a[i]; for j := i + 1 to n do Read (a[j]); Break; end; end; for i := 1 to n do begin if ((d + d2) - a[i]) > 0 then begin if ((d + d2) - a[i]) < min then min := (d + d2) - a[i]; d2 := d2 + (d - a[i]); k := k + a[i]; end else k := k + d; end; Writeln (k, ' ', min); end. SHE DONT can AC !!!! Please help me Edited by author 22.02.2009 18:27 |
Give some tests ! | TUIT_MAD | 1648. Yachts | 26 Oct 2008 21:04 | 3 |
Edited by author 26.10.2008 21:16 |
WA 15 | McArchuk | 1648. Yachts | 26 Oct 2008 01:36 | 2 |
WA 15 McArchuk 26 Oct 2008 00:47 Re: WA 15 Ibragim Atadjanov 26 Oct 2008 01:36 |
should we store the Yachts? | A.Z | 1648. Yachts | 25 Oct 2008 16:07 | 1 |
if there was some unused yachts can we destroy them? ( to not pay golden ) |
Make every month produces d yacht or may produce less? | Iliya (Java) | 1648. Yachts | 25 Oct 2008 14:30 | 3 |
|