Common BoardSorry, I have it, I just forgive write it at the sample for you. Program code has generate 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 isn't right? Xax! Sorry again. I have Acc, I just was to add "space" between numbers :) Hi! Sorry, how i can have WA 1# if my program generate 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 at first test? Do you have 16 in the end of the list? Look at the sample output - it is there Sorry, I have it, I just forgive write it at the sample for you. Program code has generate 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 isn't right? If I get WA#10 then I'm not right, but all tests in the forum I solved correcyly! It is so strnage! If you have some idea about this, may you write me? thank's a lot fuck! my box is barcelonaaaa@yandex.ru I have the same situation with my program as Aguero. paul.martynov@gmail.com I've written the program for many times,but when I submited it,I always see "MLE" or "Wrong Answer",I've submitted it for more than 10 times!!! Finally Accepted!!! OK I've found that my heap is error,and I got MLE then. Edited by author 04.03.2013 19:32 Edited by author 04.03.2013 19:32 Can you help me? Tried different tests and answers are right, but here...every time I read the same: "Wrong answer". what in test 2? Edited by author 04.03.2013 20:20 Edited by author 04.03.2013 20:20 I followed the algorithm of luckysundog which is posted in this forum and solved it C# and C++. The same code in C# and C++ gives AC, but in Java it gives Time Limit Exceeded in test 45. I improved the code to run faster but now it gives TLE 54. I tested the code against worst case of 1000000000000037, which is a prime number. And execution time for this test was 138 milliseconds which is obviously less than 1000 (1 second). For prime 10000000000000061, it takes 185 milliseconds. Does anybody know what test 54 is? Did anybody solve this problem in Java? Can you please send me the solution to hazorman@gmail.com Thanks, I know you must'll say that this is like a "Axe slyle" But i sit on this task aproximately 7 hours! And I have already sick of it, but i owed to finish it! However Programm is working! I tested it and it's all right! PLEASE HEEEELP me! I have WA# 2. (((
using System; namespace ConsoleApplication1 { class Program14 { static void Main() { int p = 0; int u = 0; int q = 0; int k = 0; int i = 0; int j = 0; int n = int.Parse(Console.ReadLine()); string[] str; int[,] x = new int[n,n]; for (i = 0; i < n; i++) { str = Console.ReadLine().Split(' '); for (p = 0; p < n; p++) x[i, p] = int.Parse(str[p]); }
int[] y = new int[x.Length]; for (i = 1; i >= 0; i--) { k++; y[k] = x[i, k - 1];
for (j = 2; j >= 0; j--) { q++; if (q == 4) break; y[q + 2] = x[j, q - 1];
for (int o = 3; o >= 0; o--) { u++; if (u >= 5) break; y[u+5] = x[o, u - 1]; } }
} for (i = 3; i >= 2; i--) { y[k + 11] = x[i, k]; k++; } for (i = 3; i >= 1; i--) { q++; y[q+5] = x[i, q-4]; } y[0] = x[0, 0]; y[15] = x[3, 3]; foreach (int s in y) Console.Write("{0} ", s); Console.ReadLine();
} } }
Please prompt, Where is the problem! And sorry for my also "Dehqon style" english. What does the test WA#3? Help!!! And where does a leap year? : "Do not forget about the leap years." Can you please show an example of a test WA#3. I write (programmed in) to C#. Thanks in advance! Edited by author 03.03.2013 04:07 Edited by author 03.03.2013 16:50 Edited by author 03.03.2013 02:41 Edited by author 03.03.2013 02:41 And a wrong way of inputing data. Then I should do it using a single string? Yeah, for example. Check it out. It works, but its still unclear for me why I dont get an AC. scanf ("%d %c",&p,&c); It is wrong :) #include<iostream> using namespace std; int main() { int a,b; cin>>a>>b; cout<<a+b; return 0; } Test #7 contain data as follows 11 00000000000 Answer is, for example 000000000003 (thank to Dmitry 'Diman_YES' Kovalioff ) Edited by author 02.03.2013 19:14 Hi! I don't pass the test 12 and I really don't know why... Could somebody explain the idea of the algorithm (maybe I am wrong....)? When it is possible I always take one per each pile. Thanks! Edited by author 02.03.2013 04:37 This problem is quite easy.You can sort the "end node",and then use the greedy algo to solve the program. It is so easy. bravo!!! but I wonder if there is a demonstration for this... I'm working on it. there are more problems like this... There was one, Workdays, that is as much as stupid as this one... Read my funny story one topic above and you will understand what is the power of this problem :) easy problem and no-sense. test this case: # 2 the answer is : Not a floating point number I have got WA at test 4,but I don't know why,I have debug my code for the whole afternoon,could you please give me some helpful tests? I get AC. Edited by author 22.09.2007 15:57 Why WA#2....... It is possible, that there is no EOL symbol in the last line. May be, it would help you. You should try test like this: Input: abc Output: cba (Without new line in the end of file). I got WA because I forgot to write the last word =) *dull mistake. I need, it'll help you. The reason is that you don`t output '\n' at the end of each line in output. help plz... #include<cstdio> #include<cmath> #include<algorithm> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) struct Point{ int x,y; Point(int x=0,int y=0):x(x),y(y){} void Read(){ scanf("%d %d",&x,&y);} int operator ^ (Point o){ return x*o.y-o.x*y;} int operator * (Point o){ return x*o.x+y*o.y;} Point operator - (Point o){ return Point(x-o.x,y-o.y);} }P[10000],buf; double dis(double a,double b,double c,Point P){ return (a*(double)P.x+b*(double)P.y+c)/(sqrt(a*a+b*b)); } double dis(Point p,Point q){ return sqrt((double)((q-p)*(q-p))); } int n; int main(){ buf.Read(); scanf("%d",&n); rep(i,n) P[i].Read(); P[n]=P[0]; P[n+1]=P[1];
bool inCon=1; rep(i,n) { if( ((P[i+1]-P[i]) ^ (buf-P[i])) * ((P[i+2]-P[i+1]) ^ (buf-P[i+1])) <0 ){ inCon=0; break; } } if(inCon) {printf("0.000"); return 0;}
double ans=19970815.0; rep(i,n){ Point N(P[i+1].y-P[i].y,P[i].x-P[i+1].x); // fa xiang double c=-(N*P[i]); double d= ((P[i]-P[i+1])*(buf-P[i+1])) * ((P[i+1]-P[i])*(buf-P[i])) >0 ?dis(N.x,N.y,c,buf) : min(dis(P[i],buf),dis(P[i+1],buf)); if(ans>d) ans=d; }
printf("%.03lf",ans*2); } |
|