|
|
Общий форумSorry, but get tired of it. Are there any suggestions, what checks test #3? > each street stretches through the whole city either from west to east or from north to south. Do these directions have any influence? I have same problem my code is #include <iostream> #include <math.h> using namespace std; int main() { int x[2],y[2],a[2],b[2]; cin>>x[0]>>x[1]>>y[0]>>y[1]>>a[0]>>a[1]>>b[0]>>b[1]; double e=((y[0]-x[0])*(y[0]-x[0])); double t=((y[1]-x[1])*(y[1]-x[1])); double u=e+t; double qq=sqrt(u); double ww=sqrt(qq); double ee=((b[0]-a[0])*(b[0]-a[0])); double tt=((b[1]-a[1])*(b[1]-a[1])); double uu=ee+tt; double qqq=sqrt(uu); double www=sqrt(qqq); double iga=ceil((www+ww)/2); cout<<iga; return 0; } what to do?help please..... 1 1 5 5 2 2 4 4 output should be 4, i think. your program gives 3. My algorithms is: make 2 rectangles first with points Dr Dee House and St Paul Cathedral second with points Gallery and Museum next find rectangle which is the intersection of the first 2. the result is width + height of the last rectangle. but still WA on test 3 1 1 5 5 2 4 4 2 output should be 2, i think. your algorythm gives 4 yeah, the algorithm is wrong I changed it and now WA on test #6 yep. the same. 1) 0 0 6 2 0 0 6 2 == 8 2) 0 0 6 2 0 2 6 0 == 6 3) 0 0 2 6 0 6 2 0 == 6 thank you. now i understand... Edited by author 12.04.2010 15:34 Edited by author 12.04.2010 15:34 HINT: dec(Ep);dec(Dp); //for Pascal Ep--;Dp--; //for C/C++ Hi, can anybody give a hint how to solve this problem? Notice that if there is an edge between i and j then a[i][j] + a[j][i] <= 1 (a is input array). The reverse is not true, but you no need to worry as unnecessary edges do not change the array a. So you have a graph, run Floyd to check if it matches with array a. the same Test: 9 answer: 10 Test: 9 answer: 1 !!! In: 1234 Answer: 5 (not zero! check that) Can the polygon vertices be given in clockwise order and the answer still be yes? Can I have coinciding points and the answer still be yes (so do I aim for regular exactly n gon?) i think in some tests input string exceed 10^5. may be actual limit is 10^6? can anyone confirm or disprove? My AC solution uses char s[100001]. it makes clear that my suspicion is wrong. thank you Edited by author 11.04.2010 16:15 "The only input line contains the nonempty string consisting of decimal digits carved on the stone." while ( c != EOF ) => WA#19 while ( c >= '0' && c <= '9' ) => AC. That is the question. Why? Discrepancy with the statement. The line is a sequence of characters terminated by a newline (CR LF characters) Thank you for responding! =) I output some debug info to cerr and get WA1. I think it is something wrong with a system. What is test case 8 ? Try this test: 4 4 1 2 2 1 3 2 3 4 2 1 4 2 Answer: 1.00 1.00 1.00 1.00 Edited by author 10.04.2010 16:20 Edited by author 10.04.2010 16:20 Thanks for the help, Boris, but I'm still getting WA8, eventhough it gives me correct result for this test case. I HAVE WA6 where my mistake??? program Project1402; {$APPTYPE CONSOLE} function factor(a:integer):int64; var i:integer; f:int64; begin f:=1; for i:=1 to a do f:=f*i; factor:=f; end; var i,n:longint; s:int64; begin readln(n); if n=21 then writeln('138879579704209680000') else begin s:=0; for i:=2 to n-1 do s:=s+factor(n) div factor(n-i); s:=s+factor(n); writeln(s); end; end. what program shud and what it output for test when n=1? ups above for test №5 :) for №6 -|-|- n=2? Edited by author 07.01.2008 18:51 answer for "1" is "0" :) answer for 1 is 0 and you will took AC. Refference on solution: http://pastebin.com/PMndGBGk This code provide the correct answers on my tests.... but timus compiler think, that answer is wrong. Maby i didn`t understand anything? Edited by author 10.04.2010 02:55I think the buses go both ways, like in the real life (when they come to the end they go back)... Who has WA this test. What's wrong? Could you give me some tests. What is the correct answer for this test? Is "Error in record #2. Correct number is: 9."? 2 10 90 19 Answer: Unrecoverable error. Maybe this test help you 3 335 111 222 667 Answer: Unrecoverable error. why WA? Edited by author 08.04.2010 14:57 Could you verify test #1 and my output for this test? I stressed my solution with earlier one (AC solution) and have not found any bad test or mistake. Also i tested my solution on sample test from statement. May be it connected with difference of compiler i use and your compiler. The 1st test is a 1st sample test. Your last solution gives the following incorrect answer on it: SUBOPTIMAL 0 0 0 0 0 0 6 0 0 0 0 0 Edited by author 18.11.2009 14:05 I have tested it again. Result is as in the statement. Could you place somewhere you compiler.. I can't find it for free. Edited by author 18.11.2009 14:22 Edited by author 18.11.2009 14:22 Why my solution has Stack Overflow on test case #7? Could you admins please just tell me where the overflow happens (on which stack/array)? Or is it an infinite recursion in a function? |
|
|