Общий форумIt says: The Secret is a regular junction (+) with one of the objects of special interest contained inside. This object of interest is accessible from any of the four sides of the junction. As far as I understand, "the four sides of the junction" means left, right, up and down. In this case, the answer for the following test: ..+.. ..+.. ++#++ ..+.. ..+.# should be 10 01 because there's no way we can reach the middle Secret. Meanwhile, a program that outputs 11 11 gets AC, while the one that outputs what I think is correct gets WA at 6th test. The clarification that may help people having this problem is: one can access the Secret object not only from those 4 sides, but also diagonally. Or those 4 sides are diagonal sides Or too complex ? What q,r for test in example ? All are complex! in example: q1=-2i r1=2 q2=-3i r2=-3 Complex, but with integer components my AC solutions don't add on result on ranklist!!! :( I solved 222 tasks, but in ranklist I solved 221 task! why bug? sorry for my bad english. Edited by author 23.08.2008 18:36 Yes, rank list does not update :( Vladimir Yakovlev (USU) Fixed [1] 24 авг 2008 02:46 Sorry for inconvenience! The judge engine is updated frequently, such bugs may appear some times. Edited by author 24.08.2008 03:56 Edited by author 03.09.2008 18:05 Edited by author 23.08.2008 22:49 For each mass store amount of possibilities you can get it. If this number exceeds to than you can lower it downto 2. NumGet: array[0..MaxCardMass * MaxCards] of byte; For each mass store atleast one (if possible) card wich can create that mass. WhatGet: array[1..MaxCardMass * MaxCards] of byte; You need 1000*100 * 2 arrays of bytes. Start DP with 0 cards; NumGet[0] := 1; for CurrentCard <- 1 to CardCount do for i <-SumOfAllCards - CardWeight[CurrentCard] DOWNTO (!!!) 0 do if NumGet[i] <> 0 then Inc(NumGet[i + CardWeight[CurrentCard]], NumGet[i]); if NumGet[i + CardWeight[CurrentCard]] > 2 the NumGet[i + CardWeight[CurrentCard]] := 2 if WhatGet[i + CardWeight[CurrentCard]] = 0 then WhatGet[i + CardWeight[CurrentCard]] := CurrentCard; Downto needed to avoid next trap: consider we can get mass 100 know we check card with mass 10 when i = 100 we mark that we can get 110 when i = 110 and it is (already marked) we mark 120 when i = 120 ... ... Hope this will be helpfull...
I have the same idea as you.but i got WA.Please help me. I think we should check if there is no solution(output 0) first,and then check if there is more than one solution(output -1). am I right? Here is my program: [code deleted] Edited by moderator 27.03.2007 09:45 Knapsack at all, guys, as well :) It's so helpfull... Thank you. :) Getting wrong answer on test case 6. But i think my program is correct can anybody tell me what is the test case for 6? Give me some tests I have no tests, but it could be overflow or wrong compare function I had WA5 when I performed sort for X/Y and X/Z only. Adding sorting for Y/Z as well led to TL9 at least. I think that flipping X/Y around origin to make Y>=0 and flipping X/Z around origin to make Z>=0 later cannot be done independently, or there is some other problem of this type. Please, tell me what does that test look like? I have had AC. I'm failing the same test. Can anybody provide it or some details about it? Edited by author 24.08.2008 03:57 My prog got ac, but haven't passed this test: 4 1 1 1 1 1 1 1 1 1 1 1 2 correct answer - 4, answer of my prog - 2. It is obvious two objects can not be located at one point (otherwise we'd mention it in the statement). But if you have some new correct tests, you may send them to dimanyes@gmail.com, and we will add them into the test set. (usually authors care to mention only the opposite :) The compiler has been changed to VC. long long is still available but we must use %I64d instead of %lld!!! Which VC? 'cuz my VC2005 eats both %lld and %I64d, both __int64 and long long. My solution TLE. I not know program what optimal algorithm. Help me What is the most simple way to find an area of two squares' intersection? Find it as intersection of two arbitrary convex polygons, otherwise you'll bury yourself in special cases. To do so get all points of one polygon inside the other, all points of the other polygon inside the first one, and also all their intersections by non-parallel sides. Then find area of their convex hull. Angle/distance sorting step is enough to find that hull. Сразу прошу извинения за то, что пишу на русском... У меня вопрос: как может заполнена клетка, где большая буква? ........ ........ ...aa... ..aA.x.. ..a..x.. ...bb... ........ ........ ведь все те клетки, что с ней пересекаются, симметрические относительно нее. Заранее спасибо за помощь! What do you mean by "symmetric"? It's 45-degrees turn. Why this answer is not correct? 0 3 1 0 0 0 0 3 1 1 1 0 0 1 1 3 1 1 0 0 3 1 1 0 0 Teams 4 and 5 played 0-0. Outcome for ANY pair of teams must be 0-3, 3-0 or 1-1 Edited by author 22.08.2008 14:21 Can somebody explain me this test input -1 1 0 1 -1 -1 0 1 -1 output 0 0 1 3 0 3 1 0 0 Any body???? If some captain tells the truth, then for each cell of his row: A[i,j]==-1 || A[i,j] == (bool)B[i][j] If some captain lies, then for each cell of his row: A[i,j]==-1 || A[i][j] != (bool)B[i][j] Matrix B must be such that every pair B[i][j], B[j][i] is one of three forms: 1,1 0,3 3,0 (bool)x = 0 if x=0, and 1 otherwise So, for that test: 1st and 3rd captains lie. The 2nd tells the truth. This is not necessarily the only possible distribution of truths and lies. Should the interval tree be balanced? I use simple interval tree and get TL22. My program on Pascal with simple interval tree gets AC. I don't understand, what problem with C++ may you have??? I think the problem is in that fact that my 'simple interval tree' is not balanced. So in worst case (N=100000,K=2) I got too long tree. Oh, if you solve it with real tree - of course, it should be balanced! My solution works with interval tree - RSQ, so it is quite fast... I get TLE 15 with circular linked list; His trees aren't definitely good; Here is my code. Please help to find mistake. #include <stdio.h> void main() { int x,n,m,y,p,i,s,u; vv: scanf("%d",&n); scanf("%d",&m); scanf("%d",&y); if (n<=0 || n>=999 || m<=1 || m>=999 || y<=0 || y>=99) goto vv; u=-1; s=0; x=0; while (x<=(m-1)) { p=1; for (i=1; i<=n; i++) { p=p*x; } if ((p % m) == y) { printf("%d ",x); s++; } x++; } if (s==0) printf("%d\t",u); } What range have 1st step? For example, for MEDUIM (period == 500) is it [0..499] or [0..500] ? The same question for last step: [Tmax-perion, Tmax-1] or [Tmax-period,Tmax] ? And, output is defined incorrectly a bit: "In the first line output the number of “PERFECT” step-periods, ..." - any word about word "Perfect" in output. Follow the format, described in sample. Range is of couse [0;500) It's quite obvious. We have only three logical possibilities for that: [0;500] is ambiguous because it overlaps with [500;1000]. (0;500), [0;500) and (0;500] can be tested vs. input. |
|