| Show all threads Hide all threads Show all messages Hide all messages |
| WA on test #11 | sanok | 1600. Airport | 19 Jan 2009 00:43 | 1 |
Could someone give me a hint (or test) to help me to fix WA on test #11? |
| Little hint for you | Marko Bogdanovic | 1313. Some Words about Sport | 19 Jan 2009 00:33 | 3 |
Just use secondary diagonals of (1,1), (2,2),...,(n,n) matrixs (this wasn't regular plural of noun matrix , excuse me for my grammar). p.s that was my way, maybe there is another Edited by author 05.05.2005 07:06 More Hint: Maybe you can use BFS. Enqueue position adjacent to itself. But think of which one could be enqueued first. i agree, and then recursively call print function to walk through every pixel.. very easy problem,, got AC |
| Nice Solution [Not Code] | Michail Yudin | 1679. Scrooge's Tower | 18 Jan 2009 21:47 | 2 |
Heh, i take some day to solve this problem. Solution, by Master Herr Nikita Glashenko (Никита Глащенко), because my solution got (i move sqare from 0 to pi/2) TLE (slow code). Do next: take one point and mirror it in front of and sheer from O(0,0). Example: 3 4, -3-4, 4-3,-4 3. And take the equalization of the line catched on two points(x1,y1) (x2,y2). if size of chord(lying on the line catched on two points(x1,y1) (x2,y2))=r*sqrt(2)[use approximation 1e-7 for example] in one of the four variants (for four point, what you get), then 'yes' else 'no'. PS: Division by zero mit uns(with us), you should control it. Too difficult solution. All you should do for every case - just consider two squares... |
| Crash (access violation) why? | Zharenkov_ssau | 1654. Cipher Message | 18 Jan 2009 21:44 | 3 |
Edited by author 18.01.2009 21:44 if i=1, s[i-1] might be not defined thanks...very stupid mistake... |
| I'm puzzled | xwj1234 | 1013. K-based Numbers. Version 3 | 18 Jan 2009 20:52 | 2 |
How can some of the programs solve this problem within 0.001 s? Simply because this problem has nothing to do with iterations but with permutation and combination. How many different representation for the sample are there [0, 1] over 10 positions it is 2^10 = 1024 but you cannot have "0" at 1st position so 2^10 - 2^9 = 512 and like so you continue to subtract the permutations where you would have two successive zeros and at the end you should get 90.
|
| Basic test | Ekvilon | 1663. The Hobbit or There and Back Again 2 | 18 Jan 2009 16:38 | 6 |
If Hobbit moves in order 1->4->2->3 (like in basic test answer), he will pay 2816. But if he moves in order 1->3->4->2, he will pay only 2050. So why minimal price way is "1 4 2 3"? 1->4->2->3 10*1000/4 + 4*1000/3 + 3*1000/5 = 4433 1->3->4->2 10*1000/5 + 5*1000/4 + 4*1000/3 = 4583 So? 1->3->2->4 10*1000/5+5*1000/3+3*1000/4==4415 Edited by author 20.12.2008 15:07 Edited by author 20.12.2008 15:07 Why not so! 1-4-3-2 4*[1000/10]+5*[1000/4]+3*[1000/5]+10*[1000/3]= 4*100+5*250+3*200+10*333=400+1250+600+3330=5580 and 1-4-2-3 4*[1000/10]+3*[1000/4]+5*[1000/3]+10*[1000/5]= 400+750+5*333+10*200=1150+2000+1665=4815 and 1-4-3-2 is better! Edited by author 10.01.2010 05:25 Edited by author 10.01.2010 05:28 Read the task carefuly! "Remember that Bilbo starts his travel from the city with number 1, visits each city exactly once and returns to the city with number 1 only in the end." Bilbo will return to city 1 in the end, so we must calculate the cost of 1->4->2->3->1 and it is equal to: 4*[1000/10] + 3*[1000/4] + 5*[1000/3] + 10*[1000/5] = = 4*100 + 3*250 + 5*333 + 10*200 = 4815. |
| what is in test #03 | Hasnae Rehioui | 1654. Cipher Message | 18 Jan 2009 15:57 | 2 |
i'm also have wa 3...why i don't now..need some tests.. ps excuse me for my elglish) what answer will be for input:' ' ?empty string or ' '? Edited by author 18.01.2009 16:25 Edited by author 18.01.2009 16:25 |
| How to write a solution on my favourite programming language? To admins! | Asyamov Igor | | 18 Jan 2009 14:30 | 1 |
Why there is not a section, how to write C# solutions??? |
| WA14 Need tests. Here my code | Michail Yudin | 1679. Scrooge's Tower | 18 Jan 2009 14:27 | 1 |
Edited by author 18.01.2009 18:00 |
| please,help me!! | zrp | | 18 Jan 2009 14:12 | 3 |
could anyone here tell me if there are any problem about "maximal matching problem" |
| used algos | strider | 1027. D++ Again | 18 Jan 2009 12:57 | 1 |
I've read in one of the posts below that the problem is to be solved by recursive deleting of comments/arithmetics (at least i've got so). I suppose the problem is solvable with char-by-char reading. It's necessary to remember only one previous character and to update some conditions like "we are in comment", "we are in arithmetic expression", ... at the proper time. I've got AC with such an algo. |
| Infinity? | bve | 1677. Monkey at the Keyboard | 17 Jan 2009 08:30 | 1 |
Test: 2 aa Answer: 6 Why not just Inf? |
| Could you tell me what's wrong with my program?(I got WA 2) | yuyan | 1665. Dean's Financial Pyramid | 16 Jan 2009 19:07 | 3 |
What's wrong with my program?Could you give me some test? Thank you! Sorry for my poor English!:) Here is my program: #include<iostream.h> int main() { freopen("financial.in","r",stdin); freopen("finiancial.out","w",stdout); int testcase; cin>>testcase; int i,m,n; bool flag; for (int t=1;t<=testcase;t++) { cin>>n; m=1; while (n%2==0) { n=n>>1; m+=1; } if ((m%2==1) && (n>1)) cout<<"YES"<<endl; else { flag=false; for (i=2;i<=n-1;i++) if (n%i==0) { flag=true; break; } if (flag) cout<<"YES"<<endl; else cout<<"NO"<<endl; } } return 0; } Thank you for your help! try this test 1 8 the correct answer is YES, but your answer is NO Thanks for your help. I got AC finally. |
| About Digit Pi | Ivan Dermansky | 1020. Rope | 16 Jan 2009 19:02 | 5 |
Hello! Sorry for my language. I have not found in C++ (Microsoft Visual Studio 2008) function for digit Pi, and input it self - "float Pi=3.1415926" and i recived WA in test 3, but when i use Pi=3.141_!6!_926 (It's wrong!) I got Accepted! What you think about this? you can find const M_PI in <math.h> M_PI is not defined under Ansi C or the judge. if you write #define _USE_MATH_DEFINES #include <math.h> then you can use M_PI
|
| WA5 | M@STeR.SoBG | 1440. Training Schedule | 16 Jan 2009 01:07 | 3 |
WA5 M@STeR.SoBG 12 Apr 2008 20:16 What is 5th test? could anybody help me?? Some ideas, some tests... Monday December 24 17 17 Right answer is 1 Tuesday Re: WA5 Oleg Strekalovsky [Vologda SPU] 16 Jan 2009 01:07 The idia of solution is simple. You mast calculate counts of each day of Week from 2 Sep to limit date-1. After then , you mast select days, acording they count. Complexity = 2^7 |
| WA7 | pperm | 1670. Asterisk | 15 Jan 2009 15:08 | 3 |
WA7 pperm 14 Jan 2009 16:34 Give me plz some tests. Please only good permutation :) 4 1 4 2 3 This test help me) (1, (2,3) * (4)) = (1,4,2,3) Wa 7 again :) 9 3 2 1 7 9 8 4 5 6 ((1)*(2)*(3),(4,5,6)*(7,(8)*(9))) |
| WA on #4, please help | Danica Porobic | 1287. Mars Canals | 15 Jan 2009 12:50 | 6 |
I keep getting WA on testcase 4, but I'm sure my program is correct. Can someone give me this test or send me AC program or just tell me what is the trick in this testcase? Send me too,pleeeeeeeeeeeeeeeeeeeeese The only problem is that it was 3 years ago :))) sSSSS sSsSs SsSss ssSsS sssSs output S 4 |
| PPERM CAN YOU HELP ME TEST#5 OF 1436 ? | K-A-R-E-N | 1436. Billboard | 14 Jan 2009 22:39 | 2 |
Test 5 doesn't matter! When we formulate our solution mathematically rightly tests may be from 1 to 1000 and so on.You should your self determine where your house may take winds. |
| WA #3 | Al.Cash | 1281. River Basin | 14 Jan 2009 19:06 | 1 |
WA #3 Al.Cash 14 Jan 2009 19:06 Can somebody help me with this test? I think there is some small bug in my program or in the statement understanding, but I can't find it... An appropriate test would help me a lot. |
| Забавно | Michail Yudin | 1298. Knight | 14 Jan 2009 18:21 | 1 |
Забавно Michail Yudin 14 Jan 2009 18:21 моя прога Uses SysUtils,Math; {$APPTYPE CONSOLE} var i,f,j,n,c,x,y,x1,y1:integer; a:array [-1..10,-1..10] of byte; b:array[1..8] of char=('a','b','c','d','e','f','g','h'); procedure proc(k,l:integer); var min,i1,j1:integer; begin for i1:=-2 to 2 do for j1:=-2 to 2 do if (abs(i1)+abs(j1)=3) and (a[k+j1,l+i1]=0) then inc(min); if min<c then begin c:=min; x1:=k; y1:=l end;
end; begin {$ifndef online_judge} reset(input,'input.txt'); rewrite(output,'output.txt'); {$endif} fillchar(a,sizeof(a),1); readln(n); for i:=1 to n do for j:=1 to n do a[i,j]:=0; case n of 1:writeln('a1'); 2:writeln('IMPOSSIBLE'); 3:writeln('IMPOSSIBLE'); 4:writeln('IMPOSSIBLE') else begin x:=1; y:=1; f:=0; repeat c:=10; a[x,y]:=1; writeln(b[x],y); for i:=-2 to 2 do for j:=-2 to 2 do if (abs(i)+abs(j)=3) and (a[x+j,y+i]=0) then proc(x+j,y+i); inc(f); x:=x1; y:=y1; until f>=sqr(n); end; end; end. Фишка в том, что прога оптимально(!) обходит псведошахматную доску с заданными размерами ребер n<=8 и находит решение по обходу доски конем, чтобы он только один раз наступал на одно поле(я проверял), но правда, поскольку решение отличается от того что в тестах, приишлось сдать массивом конастант... обидно. Если есть возражения, пишите! |