Common Board| Show all threads Hide all threads Show all messages Hide all messages | | I GOT AC!!!!!!!! | FELIX | 1024. Permutations | 4 Sep 2010 22:39 | 2 | i'm so glad that i can do the problem on myself!!!i come up with the right way to solve the probmlem,but i forgot about the time.so i time time limit exceeded.then i did some work and——i got ac!!!here's the for example to the problem,hope to help you:4?3=12,and 2?3=6. cycle length + GCD thats all. | | Why I got WA on #15? | HJ | 1151. Radiobeacons | 4 Sep 2010 21:33 | 2 | | | WA 12, what's wrong ? | Alias (Alexander Prudaev) | 1151. Radiobeacons | 4 Sep 2010 21:32 | 3 | RSignJ - distance from checkpoint I to beacon J - can be 0 | | What does SURFACE mean? | TestKiller | 1315. MDPAR and MIIAR | 3 Sep 2010 21:02 | 1 | In the text, what does the word SURFACE mean? Consider the following case: 3 6 2 2 3 #.# #.# #.# #.# ... ### Can he rescued by himself?????? | | Sort users by country | Alexander Georgiev | | 3 Sep 2010 11:56 | 3 | Is there any possibility to make Authors Ranklist also viewable per country? I mean every country to has a separate ranklist for just its coders. Shouldn't be more than few lines of code and one WHERE clause more in the database query :) For what purpose? Country shouldn't be a parameter by which you can sort people. Are you nationalist? I mean only add an option to show only people from a certain country. I would like to see how are the other people from my country doing. | | A very nice DP problem.My algorithm is the best of all,it's only O(n*m). | Blue cat | 1144. The Emperor's Riddle | 2 Sep 2010 18:33 | 7 | Could you give me any hints of the DP algorithm? Thanks! (mail to: comars@hotmail.com ) If it is NP, the complexity of the algorithm should be O (K*something) right ? Can you give me any hints on your solution ? mail: scythe@toughguy.net thanx a lot Could you give me any hints of the DP algorithm? Thanks! (mail to: cpp_student@163.com ) I also think it's nice!My algorithm use 0.5s.I use some random.It's nearly O(n*m) can you give your solution?? Thx remdy21@live.cn | | Faster than using suffix array? | Vlad | 1706. Cipher Message 2 | 2 Sep 2010 18:17 | 1 | I naively applied suffix arrays with lcp and got AC in ~2.7s. (complexity N*K*log^2(K)) But I see that there are submissions with times <0.1s. What are the more efficient algorithms? Someone mentioned suffix-function - any referece for that? Also it was said that KMP can be used - can anyone explain how exactly it is applicable here? Thanks in advance. | | sample | Edric Mao | 1143. Electric Path | 2 Sep 2010 16:41 | 1 | sample Edric Mao 2 Sep 2010 16:41 can you explain the sample for me Thx | | what's wrong? | Edric Mao | 1140. Swamp Incident | 2 Sep 2010 16:39 | 1 | program ural; uses math; var s:array['X'..'Z']of integer; c:char; d,n,i:integer; begin readln(n); for i:=1 to n do begin read(c); readln(d); s[c]:=s[c]+d; end; if(s['X']>0)and(s['Z']>0)then begin d:=min(s['X'],s['Z']); inc(s['Y'],d); dec(s['X'],d); dec(s['Z'],d); end else if(s['X']<0)and(s['Z']<0)then begin d:=max(s['X'],s['Z']); inc(s['Y'],d); dec(s['X'],d); dec(s['Z'],d); end; if(s['X']>0)and(s['Y']<0)then begin d:=max(-s['X'],s['Y']); inc(s['Z'],d); inc(s['X'],d); dec(s['Y'],d); end else if(s['X']<0)and(s['Y']>0)then begin d:=min(-s['X'],s['Y']); inc(s['Z'],d); inc(s['X'],d); dec(s['Y'],d); end; if(s['Z']>0)and(s['Y']<0)then begin d:=max(-s['Z'],s['Y']); inc(s['X'],d); inc(s['Z'],d); dec(s['Y'],d); end else if(s['Z']<0)and(s['Y']>0)then begin d:=min(-s['Z'],s['Y']); inc(s['X'],d); inc(s['Z'],d); dec(s['Y'],d); end; writeln(abs(s['X'])+abs(s['Y'])+abs(s['Z'])); if s['X']<>0 then writeln('X ',-s['X']); if s['Y']<>0 then writeln('Y ',-s['Y']); if s['Z']<>0 then writeln('Z ',-s['Z']); end. | | If you have CRASH... | Burmistrov Ivan (USU) | 1329. Galactic History | 2 Sep 2010 15:35 | 2 | If you have CRASH, may be, will help for you to make columns of a global variable and to clean from definitions of procedures. I got AC... Maybe you should increase the stack size as well. | | Tips | MAK | 1329. Galactic History | 2 Sep 2010 15:33 | 1 | Tips MAK 2 Sep 2010 15:33 If you get WA2 try this one: Input: 3 3 2 2 1 1 -1 3 1 2 3 2 1 3 Output: 1 2 1 Also if you get WA12 pay attention for: "All identifiers lie between 0 and 40000." | | why is the sollution code for 1001 wrong | Yeqianqian | 1001. Reverse Root | 2 Sep 2010 14:09 | 1 | #include <iostream> #include <iomanip> #include<math.h> #include<vector> using namespace std; int main() { cout<<setiosflags(ios::fixed)<<setprecision(4); vector<double>v; double a; for(int i=0;!cin.eof();i++ ) { cin>>a; v.push_back(sqrt(a)); } for(int j=v.size()-2;j>=0;j--) {cout<<v[j]<<"\n";} return 0; } | | No subject | time-lizk | 1489. Points on a Parallelepiped | 2 Sep 2010 12:29 | 2 | How to control the output precision?What does "to the acuracy of 10-6? Up! Why in task 10^6, but output 10^16 | | why wa2?I have tried many tests,and output the right answer,but WA2 | uuu | 1215. Exactness of Projectile Hit | 1 Sep 2010 20:20 | 1 | var i,j,k,n,m,tot:longint; ans,x1,y1,x2,y2,d1,d2,d3,x,y,angle1,angle2,t,p1,p2:double; function min(xx,yy:double):double; begin if xx>yy then exit(yy); exit(xx); end; begin {assign(input,'1215.in');reset(input);} read(x,y,n); read(x1,y1); p1:=x1; p2:=y1; d1:=sqrt(sqr(x-x1)+sqr(y-y1)); ans:=999999999; tot:=0; for i:=2 to n do begin read(x2,y2); if (x1<x)and(x2>=x)and((y1<y)or(y2<y)) then inc(tot); d2:=sqrt(sqr(x-x2)+sqr(y-y2)); d3:=sqrt(sqr(x1-x2)+sqr(y1-y2)); angle1:=(d2*d2+d3*d3-d1*d1)/(2*d2*d3); angle2:=(d1*d1+d3*d3-d2*d2)/(2*d1*d3); if (angle1>=0)and(angle2>=0) then begin if x1=x2 then t:=abs(x1-x) else t:=((y1-y2)/(x1-x2)*x-y+y1+(y2-y1)/(x1-x2)*x1)/(sqrt(sqr((y1-y2)/(x1-x2))+1)); t:=abs(t); ans:=min(ans,t); end else begin t:=min(d1,d2); ans:=min(ans,t); end; d1:=d2; x1:=x2; y1:=y2; end; x2:=p1; y2:=p2; if (x1<x)and(x2>=x)and((y1<y)or(y2<y)) then inc(tot); d2:=sqrt(sqr(x-x2)+sqr(y-y2)); d3:=sqrt(sqr(x1-x2)+sqr(y1-y2)); angle1:=(d2*d2+d3*d3-d1*d1)/(2*d2*d3); angle2:=(d1*d1+d3*d3-d2*d2)/(2*d1*d3); if (angle1>=0)and(angle2>=0) then begin if x1=x2 then t:=abs(x1-x) else t:=((y1-y2)/(x1-x2)*x-y+y1+(y2-y1)/(x1-x2)*x1)/(sqrt(sqr((y1-y2)/(x1-x2))+1)); t:=abs(t); ans:=min(ans,t); end else begin t:=min(d1,d2); ans:=min(ans,t); end; if odd(tot) then ans:=0; writeln(ans*2:0:3); end. | | tests | Tural Neymanov | 1579. Coat Transportation | 1 Sep 2010 11:56 | 2 | tests Tural Neymanov 13 Mar 2010 02:02 just check your program on these tests ---------- 4 3 1 5 8 10 answer: 1 8 5 10 wrong answer: 1 5 8 10 ---------- 4 2 3 5 7 10 answer: 5 10 3 7 wrong answer: 7 10 5 3 That's helped me with wa#9: 9 0 1 1 6 6 23 35 36 38 40 Right answer has 2 trips. | | Tricky (?) and valid (?) test | Maxim Delyukin aka dAFTc0d3r [Yaroslavl SU] | 1563. Bayan | 1 Sep 2010 01:06 | 3 | I know AC solution that answers 5 on this test instead of 3: /////////////start of test 6
////////////end of test 6 [1 space] [1 space] [2 spaces] [2 spaces] [3 spaces] [3 spaces] [EOF] Also this test should be answered 0 instead of 1. 2 MEXX MEXX I gues this tests suit the condition "The brands are the strings of Latin letters and blanks." and may be added. Thank you. You can Quote my post to view or copy&paste this tests. Blanks are abandoned by forum, but are in the post. No subject dAFTc0d3r [Yaroslavl SU] 1 Sep 2010 01:06 | | My prog deals with coefficients, but WA on test #16. Can anybody help me or gimme that test? | Maigo Akisame (maigoakisame@yahoo.com.cn) | 1133. Fibonacci Sequence | 31 Aug 2010 21:06 | 7 | It works like this: f1=1*f1+0*f2; f2=0*f1+1*f2; f3=1*f1+1*f2; f4=1*f1+2*f2; f5=2*f1+3*f2; f6=3*f1+5*f2; ...^....^ ...|....These coefficients are in the array c2 ...These coefficients are in the array c1 ----PROG BELOW---- program ural1133; const maxn=2001; var c1,c2:array[1..maxn]of extended; x,y,n,i:integer; fx,fy,f1,f2:longint; function min(a,b:integer):integer; begin if a<b then min:=a else min:=b; end; function max(a,b:integer):integer; begin if a>b then max:=a else max:=b; end; begin readln(x,fx,y,fy,n); i:=min(min(x,y),n); if i<=0 then begin i:=1-i; inc(x,i);inc(y,i);inc(n,i); end; c1[1]:=1;c2[1]:=0; c1[2]:=0;c2[2]:=1; for i:=3 to max(max(x,y),n) do begin c1[i]:=c1[i-2]+c1[i-1]; c2[i]:=c2[i-2]+c2[i-1]; end; f1:=round((fx*c2[y]-fy*c2[x])/(c1[x]*c2[y]-c1[y]*c2[x])); f2:=round((fx*c1[y]-fy*c1[x])/(c2[x]*c1[y]-c2[y]*c1[x])); writeln(round(c1[n]*f1+c2[n]*f2)); end. Try this: 46 1836311903 -46 -1836311903 45 Correct answer is 1134903170, but your program outputs 1073741824. No subject partisan (Andrey Korotkov) 10 Nov 2007 16:22 Edited by author 10.11.2007 16:27 I have the same problem. Can anybody help? >> writeln(round(c1[n]*f1+c2[n]*f2)); For example c1[n]*f1 may exceed extended (c1[n]*f1+c2[n]*f2 don't, but you will lost correctness), and as I understand, test from UNKNOWN LAMER (thanks!), makes it true Edited by author 10.11.2007 16:33 | | It is correct? | Vit Demidenko | 1133. Fibonacci Sequence | 31 Aug 2010 20:40 | 3 | Test 1 -2000000000 2 2000000000 3 is correct? Answer: 0 thanks i found my mistake | | Does anybody have test#3 - WA!!! | Valentine | 1265. Mirror | 31 Aug 2010 19:55 | 4 | 2 -2 0 4 0 0 2 2 ans = INVISIBLE It is not test 3. I get WA3 whith ans INVISIBLE 0 -1 2 -1 2 0 0 0 answer: visible | | WA12. Give me hint, plz. | Programmer | 1185. Wall | 31 Aug 2010 18:20 | 4 | I don`t know what bug is in my programm. Who can give me this test. Re: Help me. Vedernikoff Sergey (HSE: EconomicsForever!) 11 Feb 2009 02:31 As I remember, in 12th test the point is in precision. If you write in Pascal, use Extended (in C++ - double), use very accurate value for PI (3.1415926 is NOT enough), in Pascal use standard constant "pi", in C - 2.0*acos(0.0) Well, in my case the reason for WA#12 was inproper implementation of Graham's algorithm, not a precision. Be careful with cases, when there are points with the same polar angle. |
|
|