|
|
Common BoardProblem 1248 disappeared from my list of solved problems, but didn't appear in the list of unsolved problems. Now I've got AC but problem 1248 appeared in my list of unsolved problem... And I have 567 solved problems on my "author's page", but there are 568 solved problems in rating... Edited by author 16.04.2010 22:43 Oops! :) This problem will be investigated. vector<set<int> > and if WA 5 then test this: 9 1 2 3 4 5 6 7 8 and 10 1 2 3 4 5 6 7 8 9 Hmmmmm.... O(n^2) is too slow (-_-). I know O(N+M) solution.You have just to delte leaves, while number of vertex>2.If you will do it righ,you will get O(N+M)solution. Hi, could you please tell me what was the response of my program to the first test since it gives me a "Wrong Answer"? Any1 could give me details about it? No idea wheres my mistake I have no f... idea:/ i have WA #4 or #8. could you tell me why?:( answer of 9*9 is 88.87005769. Is it right? Edited by author 30.10.2008 07:13 Hm...my AC solution say yes Можно как-нибудь исправить эту ошибку? - Edited by author 10.02.2010 00:21 Edited by author 10.02.2010 00:21 решить задачу по-другому =) I always Wa on test#11.But does there anyone know why? Edited by author 31.12.2009 14:07 If you C++ Make sure you use long long; At first I use <stdio.h>,then I failed. Then I use <iostream>,then I passed #11. Oh!Finally I get Accepted. First i use getchar and got WA11,and I replace it with gets to read strings,and Accepted. Edited by author 15.04.2010 08:20 how do i find the number of N/2 digit combinations in which sum of digits equals to default M? ps: M starts from 1 to (N/2)*9; every time i need to calculate the current previously number of combinations Program ff; Var a,b:integer; Begin Readln(a); Readln(b); if (b-a) mod 2=0 then Writeln((b-a)/2) else Writeln((b-a) div 2+1); end. Test: 1 5 Right answer: 3 Yours: 2 Why WA#8? use int64 What to do if it doesn't help? Help anybody!!! I have WA8! Give me some helpful tests. Need I use Topological Sort if I use shortest path in DAG; Now I just use Sort by beginning of the edge. Edited by author 02.11.2009 01:59 Edited by author 02.11.2009 01:59 Oh, it was stupid mistake!!! I just increased const INFINITY in the array if distances and got AC. I really hate it when I have to resubmit just because this judge doesn't support "%lld" operator... Very strange, with typedef long long I; I get AC with #define H I(10000000000000000LL) but WA8 with # define H I(1e16) I got WA at test18, can somebody give some test or hint, please? It could be proven that for n != 4 there is always 'NO' answer. Is it right for each test? e.g. in test 8 n != 4 and answer is 'YES'. With absolute precision of calculations u will get 'NO' I read your posts very attentievely, but I didn't understand what exactly you mean. What's about test: 5 1 0.5 0.654508, 0.975528 0.0954915, 0.793893 0.0954915, 0.206107 0.654508, 0.0244717 I am sure the answer is YES i've got memory limit on test #3 what can i do??? i use array of int64[1..200000] Edited by author 11.04.2010 19:24 Edited by author 11.04.2010 19:41 ar vici mec ver amovxseni shetanashi maq etyoba shecdoma while not eof do read(n); :( When I wrote my first version, I had TLE#13. I optimize it - Crash#13. Help me with tests or hints. Please. Thanks. Edited by author 10.05.2006 20:37 I guess in this test one needs to add to the largest section (and N*M is not very small) -- I had a problem with 1e8 sentinel. This test helped me a lot. 2 2 10 1 3 2 4 Output is: 5 what's wrong? program t1688; var h:array [1..3000] of int64; a,p:int64; n,m:int64; b,i,j:longint; begin readln(a,b); for i:=1 to b do readln(h[i]); for i:=1 to b-1 do for j:=b downto i+1 do begin if h[i]>h[j] then begin p:=h[i]; h[i]:=h[j]; h[j]:=p; end; end; for i:=1 to b do begin m:=m+h[i]; if a*3<m then inc(n); end; if n=0 then writeln('Team.GOV!') else writeln('Free after ',b-n,' times.'); end. Edited by author 16.04.2010 11:37 Any help? Does someone here know the reason why so many people fail on test 8? problem solved Edited by author 13.04.2010 14:37 Edited by author 13.04.2010 14:37 I got WA6 in this case: if (inc1 == inc2) { cout << labs(cr2x - cr1x) + labs(cr2y - cr1y); return; } cout << max(labs(cr2x - cr1x), labs(cr2y - cr1y)); but I got AC in this case: if (inc1 == inc2) { cout << (cr2x - cr1x) + labs(cr2y - cr1y); return; } cout << max(labs(cr2x - cr1x), labs(cr2y - cr1y)); and in this case: if (inc1 == inc2) { cout << labs(cr2x - cr1x) + (cr2y - cr1y); return; } cout << max(labs(cr2x - cr1x), labs(cr2y - cr1y)); and in this: if (inc1 == inc2) { cout << (cr2x - cr1x) + (cr2y - cr1y); return; } cout << max(labs(cr2x - cr1x), labs(cr2y - cr1y)); p.s. cr1x, cr1y, cr2x, cr2y is long long, (cr2x - cr1x)>=0 and (cr2y - cr1y)>=0 always, but why in this case does not labs() work correctly ? Letter 'l' in "labs" stands for "long" = "int" (not "long long"). So in the first case two summands are converted from "long long" to "int" and the summation causes overflow. In the second and the third cases one of the summands has type "long long" so the sum is in type "long long" too. Edited by author 12.04.2010 22:11 0.001 142 КБ You real-true-mega-shguzhii coder ! How you write this program? let a[i] stand for the member of party i; sort it to make a[1]<a[2]<...<a[n] for i:=1 to (k+1) div 2 do inc(answer,(a[i]+1) div 2); the answer is sure to be the best one. I have such sing too,but say me how you write this program I don't understood! |
|
|