Common Board| Show all threads Hide all threads Show all messages Hide all messages | | I got AC but my program won't work for certain tests! | Daniel Mahu | 1006. Square Frames | 4 Apr 2009 22:33 | 3 | I searched squares starting from each corner. This got me AC. Here is a test for which my program fails: 5 1 1 4 1 1 2 1 4 2 4 1 2 4 4 2 You will notice that if you try to reconstruct the squares starting from the corner images (the way my implementation does), you will find the small squares of width 2 but not the larger one (whose corners have been completely hidden). However, the edges of the larger square will have remained uncovered by that solution. You might want to consider adding a similar test to the test data. In fact, there are some uncertainties if squares are overlapping too much. The problem does not require us to find the smallest number of frames, hence it is ok in this case if our solutions produce 2 small squares instead of 1 big square. My first message was actually right, but it no longer applies - they rejudged the problem apparently, and my program that initially got AC now fails on test 6. So just skip this thread. Incidentally, I don't know how to fix my submission yet, but that's another thing :) | | WA#1...i don't understand why | Dexter | 1588. Jamaica | 4 Apr 2009 20:18 | 2 | I tested my code with many test cases and it always worked (even with N=1 - answer is 0). But when I submit the solution I always get WA on first test case. And I don't know why. Can I get the first test case so I can find out why my code doesn't work? I used Dev-C++ environment and C language (not C++). Edited by author 05.04.2009 16:46 Edited by author 05.04.2009 16:48 | | What does "punctuation signs" mean? | Blue Mary | 1704. Demodulation | 4 Apr 2009 16:23 | 1 | All printable nonspace & non-letter characters? | | J | Victor Barinov (TNU) | 1709. Penguin-Avia | 4 Apr 2009 15:13 | 2 | J Victor Barinov (TNU) 4 Apr 2009 13:26 Why in sample output last line has only 0's??? Re: J Ildar Valiev 4 Apr 2009 15:13 It means, that aeroport #6 haven't any changes in it's routes. | | I can't understand? | yaho0o0 | 1705. Gangster Hares | 4 Apr 2009 13:43 | 1 | Why on the 1 test the corect answer is not 2 2 3 | | WA#3 | Dejan Mijic | 1592. Chinese Watches | 3 Apr 2009 23:53 | 1 | WA#3 Dejan Mijic 3 Apr 2009 23:53 Could someone give some useful tests for this problem? My code seems to give good output for all tests posted here, but i still get WA #3. | | WA #10. I need test. | Глащенко Никита | 1679. Scrooge's Tower | 3 Apr 2009 21:15 | 14 | Give me some test, please. I thought out many tests, but my program always gives right answers. I need test for WRONG ANSWER!!! Edited by author 18.01.2009 15:26 Yeh, but if do the more rules for input control... program go to wa2.... fuck. Test! Anybody. thx a lot. For Michail Yudin. Messages should not contain offences, obscene words and correct solutions. Heh... Edited by author 12.01.2009 11:45 For Michail Yudin. Messages should not contain offences, obscene words and correct solutions. Heh... Edited by author 12.01.2009 11:45 You program should not contain mistakes.... Heh... Edited by author 27.10.2012 23:03 My advice. Break off double at all. Use __int64 instead. For example. sqrt(x*x+y*y)<=R ~ (x*x+y*y)<=R*R. On this way you can make you algo absolutely i.e, mathematically correctly. Эх, это не идея... Так только уберет совсем невозможные варианты. Это реализовано мной... Wa10. Я попробовал проверить приндлежность двух точек одному потенциально возможному в окружности с данным радиусом вписанному квадрату... и получил wa2. полный трындец... можно конечно понасиловать тимус, чтобы добыть тесты... но это плохой дао. так как старость может придти раньше успеха. Кто-нибудь дайте AC-алгоритм, или его математическую реализацию.... я больше не могу ничего придумать PS. if you want translate... use RU-EN translator. Use for example a system: s*x1+t*y1==R/sqrt(2) s*x2+t*y2==-R/sqrt(2) must be:s^2+t^2==1 Thx a lot... True algo. How do you got it Wise man? if it not secret. But test 9 5 5 -5 -5 this algo do bad. correct answer - yes. answer this algo - no Edited by author 16.01.2009 23:00 Edited by author 16.01.2009 23:01 Edited by author 16.01.2009 23:02 My advice. Break off double at all. Use __int64 instead. For example. sqrt(x*x+y*y)<=R ~ (x*x+y*y)<=R*R. On this way you can make you algo absolutely i.e, mathematically correctly. What does this formula stand for? I don't know what is "~" here? Is this enough to solve the problem, or is there anything else to be considered? Thanks many questions! see my site svrsvr.far.ru at this place a will give full explanations soon 2 9 5 5 -5 -5 9 5 5 5 -5 YES YES
Thanks, but my program gives the same answers. | | HELP ME PLEASE | @ntiFreeze | 1195. Ouths and Crosses | 3 Apr 2009 19:41 | 2 | I have Wrong Answer 14. I am testing my program nearly 2 hours and I can't find mistake. who had WA14 please tell me what kind of test is it? please help huh I got AC. very silly mistake :(( Edited by author 24.02.2007 01:11 I had WA 14 too. There is a mistake in my program: one of my functions used the global variables but some of variables shouldn't be global. Now is AC. | | why my program got WA?Please help me! | NeverGiveUp | 1157. Young Tiler | 3 Apr 2009 17:00 | 2 | var a:array[1..10000]of integer; m,n,k,i,j:integer; begin fillchar(a,sizeof(a),0); readln(m,n,k); for i:=k+1 to 10000 do begin for j:=1 to trunc(sqrt(i)) do if i mod j=0 then a[i]:=a[i]+1; if (a[i]=n)and(a[i-k]=m) then begin writeln(i);halt;end; end; end. because your algorithm is wrong | | Why I have WA #8? | Clark_Farisson | | 3 Apr 2009 00:13 | 1 | Why I have WA #8? I think my program isn't wrong. Some test data can you give me? #include<iostream> #include<vector> #include<cmath> #include<algorithm> #include<string> using namespace std; string sub(string a,string b) { int c=max(a.length(),b.length()); string s1(c-a.length(),'0'),s2(c-b.length(),'0'); s1+=a;s2+=b; int naum=0;string s3;for(int i=c-1;i>=0;i--) { s3+=(s1[i]+s2[i]-96+naum)%10+'0'; naum=(s1[i]+s2[i]-96+naum)/10; } if(naum)s3+=naum+'0'; reverse(s3.begin(),s3.end()); return s3; } string umn(string a,int b) { int naum=0; string c; for(int i=a.length()-1;i>=0;i--) { c+=((a[i]-'0')*b+naum)%10+'0'; naum=((a[i]-'0')*b+naum)/10; } if(naum)c+=naum+'0'; reverse(c.begin(),c.end()); return c; } string umn1(string a,string b) { string c="0"; for(int i=0;i<b.length();i++) { string e(b.length()-i-1,'0'); c=sub(c,umn(a,b[i]-'0')+e); } return c; } string razl(string a,string b) { int c=max(a.length(),b.length()); string s1(c-a.length(),'0'),s2(c-b.length(),'0');s1+=a;s2+=b; int naum=0; string s3; for(int i=s1.length()-1;i>=0;i--) { int a=s1[i]-s2[i]; if(naum){a--;naum=0;} if(a<0){naum=1;a+=10;} s3+=a+'0'; } reverse(s3.begin(),s3.end()); while(s3[0]=='0'&&s3.length()>1)s3.erase(0,1); return s3; } string int_to_str(int n) { string s; while(n){s+=n%10+'0';n/=10;} reverse(s.begin(),s.end()); return s; } int cmp(string a,string b){ if(a==b||a.length()<b.length()||(a.length()==b.length()&&a<b))return 1; return 0; } int main() { /* cout<<sub("112","33")<<endl; cout<<razl("112","33")<<endl; cout<<umn1("112","33")<<endl; */ string s; cin>>s; if(s=="0"){cout<<0<<endl;return 0;} s=umn(s,2); string res; vector<string>a; int j=0; if(s.length()%2==1) { j=1; string m;m+=s[0]; a.push_back(m); } for(int i=j;i<s.length();i+=2) a.push_back(s.substr(i,2)); int x; if(a[0].size()==1)x=a[0][0]-'0';else x=a[0][0]*10+a[0][1]-528; double m=sqrt((double)(x)); int n=(int)(m); res=int_to_str(n); int q=x-n*n; string f; f=int_to_str(q); for(int k=1;k<a.size();k++) { string y=res; int l; y=umn(y,2); f+=a[k]; //cout<<f<<endl; string j[20]; if(f[0]=='0'){res+="0";continue;} char c='0'; j[0]=umn(y+c,c-'0'); //cout<<j[0]<<endl; c='1'; j[1]=umn(y+c,c-'0'); //cout<<j[1]<<endl; if(cmp(j[0],f)==1&&cmp(j[1],f)==0) {res+="0";l=0;} for(int i=2;i<=9;i++) { c=i+'0'; j[i]=umn(y+c,i); //cout<<j[i]<<endl; if(cmp(j[i-1],f)==1&&cmp(j[i],f)==0){res+=i-1+'0';l=i-1;break;} } if(res.length()!=k+1){res+="9";l=9;} f=razl(f,j[l]); } cout<<res<<endl; system("pause");return 0; } | | Could you tell me what is the test 29? | yuyan | 1393. Average Common Prefix | 2 Apr 2009 22:30 | 4 | I got WA#29 so many times. I can't find the mistakes from my program. By the way,is that something wrong with my "reading" part? Here is my reaing part: procedure init; begin readln(m); for i:=1 to m do begin read(ch); a[i]:=ord(ch); end; readln; end; 250000 AA...A Edited by author 16.03.2009 19:41 And test 30? I reach both memory limit and time limit. | | No subject | hhh | 1028. Stars | 2 Apr 2009 21:42 | 3 | #include <iostream> using namespace std; int n,i, j=0,s=0; int*x,*y,*a; int main() { cin>>n; x=new int[n]; y=new int[n]; a=new int[n]; for(i=0; i<n; i++) a[i]=0; for(i=0; i<n; i++) cin>>x[i]>>y[i]; while(j<n) { s=0; for(i=0; i<j; i++) { if(x[i]<=x[j]) s++; } a[s]++; j++; } for(i=0; i<n; i++) cout<<a[i]<<endl; delete []x; delete []y; delete []a; return 0; } tl#13 i dont know tree, pls tell me about that | | Only hyper-sound planes can arrive earlier than take off!!! IT'S UNBELIEVABLE!!! | BlackShark | 1070. Local Time | 2 Apr 2009 20:59 | 1 | | | HINT | DWED | 1070. Local Time | 2 Apr 2009 20:43 | 10 | HINT DWED 1 May 2004 23:39 Before sending solution, just test it on this examples. 1) 23.42 01.14 08.10 17.51 Answer: 4 2) 01.01 10.59 04.23 04.22 Answer: 5 3) 12.00 15.00 01.02 03.07 Answer: 0 4) 23.58 00.43 22.27 03.10 Answer: 2 5) 12.00 15.00 20.00 21.00 Answer: 1 6) 01.01 21.59 04.23 11.22 Answer: 5 ;) Thank you very much!!!! I've got AC!! HAHA!! Before sending solution, just test it on this examples. 1) 23.42 01.14 08.10 17.51 Answer: 4 2) 01.01 10.59 04.23 04.22 Answer: 5 3) 12.00 15.00 01.02 03.07 Answer: 0 4) 23.58 00.43 22.27 03.10 Answer: 2 5) 12.00 15.00 20.00 21.00 Answer: 1 6) 01.01 21.59 04.23 11.22 Answer: 5 ;) Re: HINT Kraev Aleksey 30 Jul 2004 17:56 Re: HINT Kraev Aleksey 30 Jul 2004 17:57 Thanks a lot! It helps me very much. I don't usually plan before writing a program, so I made lots and lots of wrong algorithms. I use your test cases and I correct , correct and recorrect my algorithms. They are wrong and wrong on test 4, 2, 5,.. (your test cases). And I got AC on the 2nd submit! Thank you! 6) 01.01 21.59 04.23 11.22 Answer: 5 why it is true? what is wrong in my& my program: var xh1, xh2, yh1, yh2 : real; xm1, xm2, ym1, ym2 : real; k, km : longint; begin read(xh1, yh1, xh2, yh2); xm1:=trunc(xh1*100) mod 100; xm2:=trunc(xh2*100) mod 100; ym1:=trunc(yh1*100) mod 100; ym2:=trunc(yh2*100) mod 100; if yh1<xh1 then yh1:=yh1+24; if yh2<xh2 then yh2:=yh2+24; xh1:=trunc(xh1); xh2:=trunc(xh2); yh1:=trunc(yh1); yh2:=trunc(yh2); k:=abs(trunc(0.5*(yh1-yh2+xh2-xh1+trunc( (ym1-ym2+xm2-xm1)/60) )) ); writeln(k); end. Thank you a lot. In your test 6 my program outputs 7. I forgot that answer should be than 6. But due to my formula (which,I hope, is correct)the answer is 7. Now I have AC. Thanks! Re: HINT Neymanov Tural 22 Dec 2007 02:20 I couldn't get 1 thing for tests 2 and 6. why answer isn't 7? if the real time of flight if 17, for 2 test and 14, for 6 test, then 17-7=10 and 14-7=7 (the differences of flights where time is "going back") and 17+7=24 & 14+7=21 (the differences of flights where time is "goting forward"). but if answer is 5 then 10+5=15 24-5=19 (<>) and 7+5=12 and 21-5=16. then wahy this test are true. I know that there must be something that I didn't saw so please help me. thanks. I'm don't understand, how can it be: 12.00 15.00 01.02 03.07 It means, that in one way plane fly 3 hours, in other - 2 hours. But in terms said, that times differs not more than 10 minutes. This test is INCORRECT! Read this post again. | | Help Wa3 | Rabidstorm | 1683. Fridge | 2 Apr 2009 19:46 | 2 | My program Wa3 This is my program: program Ural683; var a,m,n:longint; k:array[0..50]of longint; begin readln(n); m:=1; k[0]:=n; while k[m-1]<>0 do begin k[m]:=k[m-1]shr 1; inc(m); end; m:=0; a:=1; while a<n do begin inc(m);a:=a shl 1; end; writeln(m); for a:=1 to m do if k[a]=0 then write(1,' ') else write(k[a],' '); end. Who can help me? Edited by author 02.04.2009 14:18 Now I am AC!!! program Ural683; var a,m,n:longint; k:array[0..50]of longint; begin readln(n); m:=0; while n<>1 do begin inc(m); n:=n-n shr 1; k[m]:=n; end; writeln(m); for a:=1 to m do write(k[a],' '); end. | | WA #3 | Aleksandar Ivanovic | 1592. Chinese Watches | 2 Apr 2009 19:22 | 1 | WA #3 Aleksandar Ivanovic 2 Apr 2009 19:22 Can someone please help me with test case #3. I get WA on it, but my solution passes all test cases I made. :\ | | Why WA#3? | Nisarg Shah | 1592. Chinese Watches | 2 Apr 2009 19:20 | 3 | My program works on sample input and all inputs given in discussion forum. But I am getting WA3. Can anybody please give me direction or this test case? I get WA3 as well, so ca u pls help me? Edited by author 02.04.2009 05:52 Edited by author 02.04.2009 05:52 Mine too, what's the catch ? :( | | n == 0 | nikonoff (ONPU) | 1052. Rabbit Hunt | 2 Apr 2009 16:38 | 1 | n == 0 nikonoff (ONPU) 2 Apr 2009 16:38 Why does N == 0 in test 2 ? An input contains an integer N (2 ≤ N ≤ 200) ... | | Hint | [SPbSU ITMO] alant | 1347. Blog | 2 Apr 2009 15:08 | 1 | Hint [SPbSU ITMO] alant 2 Apr 2009 15:08 One blogger can mark another as his friend more than once. Of course, you should print his name in the list of friends only once. Good luck! | | I have Acc at 0.218 c, to | Валентин | 1013. K-based Numbers. Version 3 | 2 Apr 2009 10:56 | 1 | I believe that after some simplifications can be obtained even faster code |
|
|