Common Board| Show all threads Hide all threads Show all messages Hide all messages | | Week tests | Orfest (Novosibirsk SU) | 1323. Classmates | 20 Oct 2010 16:06 | 5 | Week tests Orfest (Novosibirsk SU) 20 Oct 2010 10:43 My solution works 5.5 sec on the following test. I believe my computer is faster than yours. So, please add this test and make me lose AC. 10 27 a b a c a d a e a f a g a h a i a j d h d i d j e f e g e h e i e j f g f h f i f j g h g i g j h i h j i j a Why did you add the test which is not formatted correctly ? I had go to my old pascal code, install some compiler for it and then it appears that the input format of that test is incorrect and that's why my solution fails. | | Yet another way to solve | melkiy | 1220. Stacks | 20 Oct 2010 06:45 | 1 | It seems someone have suggested to hold a common memory segment for all stacks. Here is my way to solve with some details. Allocate a large array - a common segment for all stacks, and define the size of a block. int a[BLOCKS*BLOCK_SIZE]; Each block stores (BLOCK_SIZE-1) cells for the numbers and one cells to link it with the previous block for the stack. Also it is useful to have a bit map reflecting if a particular block is occupied. Make functions find_free_block and release_block. Also i was needed a couple of arrays of int[1000]. When the next stack grows above (BLOCK_SIZE-1)*k, the new block is occupied and the stack's memory becomes BLOCK_SIZE*(k+1). On the other hand, when i can release a block after POP i do this for memory reuse. It was found experimetally at the price of 5 MLE attempts that acceptable parameters are: BLOCKS = 3200; //number of blocks BLOCK_SIZE = 50; //integers, not bytes | | It is very easy just make topogical sort!!!!!!! | Tigran92[RAU] | 1022. Genealogical Tree | 19 Oct 2010 18:57 | 1 | | | hint: wa13 | ASK | 1332. Genie Bomber | 19 Oct 2010 03:24 | 1 | Apparently, the first 12 tests are complete crap: I passed them using dx instead of dy and hypotenuse length instead of leg length. So the hint is to check your program for stupid mistakes. | | Simple Testcase | Alexander Georgiev | 1791. Uncle Styopa and Buses | 19 Oct 2010 00:08 | 1 | Be sure to pass the following testcase: 6 1 10 1 10 1 10 1 10 1 10 6 3 1 4 1 | | I am sure that there is no test in which we must output NO!!!! | Tigran92(Rau) | 1107. Warehouse Problem | 18 Oct 2010 23:38 | 1 | | | Whats wrong with my formula? | Dijkztra | 1142. Relations | 18 Oct 2010 18:12 | 3 | z = fact(z)/(2*pow(log(2),n+1)); if(fmod(z,1)>=0.5) z = floor(z) + 1; else z = floor(z); I tried the example test case and got true, but got WA with 1st test case... T_T I sent your formula and got AC. Try to output answer so: cout << fixed << setprecision(0) << z; or so: printf("%.0lf",z); And you must use double instead of float function g(x,k:longint):comp; var i:longint; q:comp; begin q:=1; for i:=1 to k do q:=q*i; g:=q*x; end; var f:array[0..20,0..20] of longint; a:array[0..20] of comp; i,j,n,k:longint; begin for i:=0 to 10 do begin f[i,1]:=1; f[i,i]:=1; end; f[0,1]:=0; for i:=1 to 10 do for j:=2 to i-1 do f[i,j]:=f[i-1,j-1]+f[i-1,j]*j; for i:=2 to 10 do for j:=1 to 10 do a[i]:=a[i]+g(f[i,j],j); readln(n); while n>0 do begin writeln(a[n]:0:0); readln(n); end; end. | | WA 13 | delin | 1786. Sandro's Biography | 18 Oct 2010 18:03 | 2 | WA 13 delin 17 Oct 2010 03:14 Re: WA 13 QAFQAZSehriyarNovruzov 18 Oct 2010 18:03 try this test jkhdSaFKrojkllSafkroppp answer 10 at first my answer is 20.I saw my bug with this test. you must find max the same letter with "Sandro" and max lowercase letter. Edited by author 18.10.2010 18:04 Edited by author 18.10.2010 18:04 Edited by author 18.10.2010 18:07 Edited by author 18.10.2010 18:08 | | WA 12 | okulov-nikolay | 1791. Uncle Styopa and Buses | 18 Oct 2010 13:37 | 1 | WA 12 okulov-nikolay 18 Oct 2010 13:37 | | How to write 0.001 solution | Nguyen Khac Tung | | 18 Oct 2010 08:03 | 5 | My best time for most programs is 0.015 at least. I see lots of 0.001s exec time . Can share how to write one ? Even the easiest problem A+B It was possible only in 2008 and earlier. Why so? More complicated tests were added? Admins can tell you. I think it's because hardware has been changed. | | No subject | Tudor Siminic | 1794. Masterpieces of World Architecture | 17 Oct 2010 17:24 | 1 | Can someone give me test 6? | | I use greedy method to choose loop in the order of DFS.But I've just found a peculiar test case that DFS will be incorrect.Is greedy method right here? | Huang Yizheng | 1077. Travelling Tours | 17 Oct 2010 13:10 | 4 | For example: 7 10 1 2 2 3 2 4 2 5 3 5 4 5 5 6 5 7 6 7 1 7 At first the DFS procedure find the loop: (1,2,3,5,6,7,1),then it'll find (1,2,3,5,7,1). and next,no loop with unused edge will be found!?! In fact,the maximum T is 3(it's obvious),but use greedy method + DFS the number of T only reach 2. Unless we regulated the order of search (it means DFS can't be right!),otherwise we have to delete a found loop to let more loop to have unused edge,then how to make the regulations? Sorry, for this example, the correct output is T = 4 !!! Check your algorithm again !!! mailto : trungduck@yahoo.com > For example: > 7 10 > 1 2 > 2 3 > 2 4 > 2 5 > 3 5 > 4 5 > 5 6 > 5 7 > 6 7 > 1 7 > At first the DFS procedure find the loop: > (1,2,3,5,6,7,1),then it'll find (1,2,3,5,7,1). > and next,no loop with unused edge will be found!?! > In fact,the maximum T is 3(it's obvious),but use greedy > method + DFS the number of T only reach 2. > Unless we regulated the order of search > (it means DFS can't be right!),otherwise we have to > delete a found loop to let more loop to have unused > edge,then how to make the regulations? > > Once DFS loop is found, it ALWAYS contains unused edge - e.g. the edge which looped it in :) Edited by author 17.10.2010 13:22 Edited by author 17.10.2010 13:22 | | WA10 | Sergey | 1038. Spell Checker | 17 Oct 2010 03:05 | 2 | WA10 Sergey 12 Mar 2010 20:09 Hello, i try send my programm but always get some WA. Can you explaint few things. First: In END of input ".?!"? When i added check for it i get 1WA. Second: "ssss[S]ssss" r there mistake? When i check for it i get 2WA Third: When i delete this conditions i get 10WA. Im confused. I've readed all threads and added conditions for every case which i found. What in 10 test? I guess the 10-th test checks for your attintive reading of the condition: "1. The first LETTER in a sentence is small." For example, the text "Hello! 238 my Friend" has an error, because the first letter in the second sentence is NOT the digit '2' but the letter 'm' which must be capital. | | Why I got WAЈїЈїЈїЈїЈїЈїЈї | qwt | 1126. Magnetic Storms | 17 Oct 2010 00:31 | 2 | var a:array[0..14000] of longint; b:array[-1..200000] of longint; n,i,j,k,max:longint; begin read(n); fillchar(a,sizeof(a),0);fillchar(b,sizeof(b),0); b[- 1]:=10000;max:=-1; for i:=0 to n-2 do begin read(a[i]); if a[i]=-1 then begin writeln(max);halt;end; inc(b[a[i]]); if a[i]>max then max:=a[i]; end; read(j); while j>=0 do begin inc(i); i:=i mod n; dec(b[a[i]]);a[i]:=j; inc(b[j]); if j>max then max:=j; while b[max]<=0 do dec(max); writeln(max); read(j); end; end. Because first chislo is m (don't n) Edited by author 17.10.2010 00:31 Edited by author 17.10.2010 00:31 | | to admins: when will the new problems be add to problemset(-) | Ibragim Atadjanov (Tashkent U of IT) | | 17 Oct 2010 00:08 | 2 | when will the new problems be add to problemset(-) | | I doubt if the ACed program is right | 198808xc | 1591. Abstract Thinking | 16 Oct 2010 21:10 | 4 | I have been thinking about the problem these days, and found that the solution is much related to the 4, 5 or 6-point groups of the N points. For the former two situations, we could simply calculate that the total number of the figures is 4 * C(n, 4) and 5 * C(n, 5) but what have we do when there are 6-point groups? According to the problem statement, the chords must intersect pairwise, so the solution for 6-point groups will be based on the detail position of the points. For example, we must find out if the chords will parallel with each other. On the other side, I found we have more than one ways to connect 6 points to form the figure. For those 6-point groups with no paralleling chords, we have actually 4 ways to connect them: (1-4, 2-5, 3-6), (1-4, 2-6, 3-5), (2-5, 1-3, 4-6) and (3-6, 1-5, 2-4). Here we numbered the points in CW or CCW order. Could anybody tell me that why the correct answer could be 4 * C(n, 4) + 5 * C(n, 5) + C(n, 6), (especially the last term) If my analysis above is right, this formula will be wrong even in N = 7. Thanks in advance. I think that's indeed the correct answer. For any 4-point group we have 4 combinations, and for any 5-point groups we have 5. So there are 4 * C(7 ,4) + 5 * C(7, 5) = 245. For any 6-point groups, as N = 7, we could know that it is a complete group for all 7 points with only one missing. So the 7 "different" groups are actually the same. Let's count how many interesting triangles in one group. For they are all the same, we take point 1, 2, 3, 4, 5, 6 on the circle, which is in CCW order (7 is missing). We have the following two ways to connect them and make them intersect pairwise: (1-4, 2-5, 3-6): a small triangle is formed inside the circle. and (1-3, 2-5, 4-6): a long triangle is formed, with 2 of its vertices inside the circle. So, there are 2 (or, at least 2) combinations for every 6-point groups in N = 7. So the total number will be 245 + 7 * 2 = 259 (or, at least 259). But all the ACed program will give the answer 252. Why? Where did I have a mistake? Anyone, please, tell me the truth about this problem. Thanks again in advance! 3 of your ways to connect 6 points are wrong: (1-4,2-6,3-5) - segments 2-6 and 3-5 don't intersect (2-5,1-3,4-6) - segments 1-3 and 4-6 don't intersect (3-6,1-5,2-4) - segments 1-5 and 2-4 don't intersect It is true, because any six different points construct a CONVEX 6-gon if they lie on one circle. Well, I suddenly realized that we should regard the CHORD as a SEGMENT, not a LINE. So the ACed programs are right. Thank you very much. | | wa 6 ? | teamsteam | 1794. Masterpieces of World Architecture | 16 Oct 2010 17:34 | 1 | wa 6 ? teamsteam 16 Oct 2010 17:34 | | No subject | Mandakhnaran | | 16 Oct 2010 16:29 | 1 | some one pls explain sandras biography plz | | No subject | Moscow SU Chapelnik (Shteiner, Panin) | 1790. Searching for the Truth | 16 Oct 2010 16:14 | 1 | No subject Moscow SU Chapelnik (Shteiner, Panin) 16 Oct 2010 16:14 We got CE for some reason while our compilers manage to run it. | | Передвижение | Tbilisi SU: Andrey Lutsenko | 1789. Searching for the Dodecahedron | 16 Oct 2010 15:03 | 2 | Для конкретного постамента, направление, куда переместится с него этот несчастный артефакт, заранее зафиксировано или он может с одного и того же постамента в одном и том же сценарии и направо ходить, и налево по своему желанию? Видимо, по своему желанию может ходить за исключением 1-го и n-ого постамента |
|
|