| Show all threads Hide all threads Show all messages Hide all messages |
| algorithm | kamran_maharov | 1051. Simple Game on a Grid | 15 Feb 2012 19:26 | 2 |
the main idea is that: if we have 2*3 sized grid we can erase top or bottom row. ... we can get either ... ... or ... using this: let's say that n<m. if n%3==0 we can convert n*m to n*3 and the n*3 to 3*3 same approach also works when m%3==0. 3*3 grid is elementary grid which we can get minimum 2 stones from it. if n%3==1 AND m%3==1 example .... .... .... .... cut this into .... .... ...^ ..^^ ^... ^... ^..^ ^.^^ ^... ^... ^..^ ^.^^ ^... ^^^^ ^^^^ ^^^^ (^ means erased stone.) After this we can get 1 stone easily. cut 1*3 pieces in first column vertically,then in bottom rows horizontally,then upper rows vertically until this figure achieved. if n%3==1 AND m%3==2 example ..... ..... ..... ..... cut this into ..... ..... ..... ....^ ...^^ ^.... ^^... ^^... ^^..^ ^^.^^ ^.... ^^... ^^... ^^..^ ^^.^^ ^.... ^^... ^^^^^ ^^^^^ ^^^^^ from this figure we can get 1 also. cut 1*3 pieces from 1nd and 2nd columns vertically,then bottom rows horizontally and upper rows vertically. if n%3==2 AND m%3==2 example ..... (finally) ...^^ ..... (finally) ...^^ ..... (finally) ^^.^^ ..... (finally) ^^^^^ ..... (finally) ^^^^^ cut 1*3 pieces vertically from 1nd and 2nd columns,then horizontally from bottom rows and vertically from upper rows.then we can reduce this grid into 1 stone. AND finally,if n==1 or m==1 the answer is ceil(n/2); Edited by author 13.06.2011 22:04 Edited by author 13.06.2011 22:05 Edited by author 13.06.2011 22:07 Edited by author 13.06.2011 22:07 Why the answer of (3m, n) is same as (3, n). Maybe we can solve (3m, n) for 1, but (3, 3) only for 2. |
| try explain to me, pls. I don't understand this example. | Сronosanz [ISPU] | 1880. Psych Up's Eigenvalues | 15 Feb 2012 03:36 | 2 |
5 13 20 22 43 146 4 13 22 43 146 5 13 43 67 89 146 1 step) you compare first and second sequence, there are such equal digits as: 13, 22, 43, 146 ( are in both sequence ) * 2 step). you must compare third sequence with sequence, what you got from first step 13, 22, 43, 146 * compare with 13 43 67 89 146. there are such equal digits as: 13, 43, 146 ( in both sequence ) 3) after step 1-2 you have 13, 43, 146 answer: 3 ( numbers in the three sequences ) |
| Crash 29 solved | shadows_s | 1880. Psych Up's Eigenvalues | 14 Feb 2012 22:20 | 1 |
Can somebody tell me what is the test 29? Thanks. Edited by author 15.02.2012 03:28 |
| If you have wa 37 try with this | scythe | 1558. Periodical Numbers | 14 Feb 2012 02:05 | 1 |
(000010000) (000010002) ----------- (000020002) |
| WA 5 solution for C++ | ONU_Latysh | 1207. Median on the Plane | 13 Feb 2012 21:52 | 1 |
if you have WA 5 try changing all data types to long long(int64) same i guess goes for other languages I had int for coordinates and got WA 5 and then just changed it to long long and AC |
| why crash? | tikuna_147 | 1585. Penguins | 12 Feb 2012 20:58 | 1 |
why crash? help me. Edited by author 12.02.2012 20:58 Edited by author 12.02.2012 20:58 |
| What is answer??? | xurshid_n | 1519. Formula 1 | 12 Feb 2012 19:25 | 2 |
10 8 **....** **....** **....** **....** ******** **....** **....** **....** **....** ******** ===> 0 or 6 or 6*6 = 36 ?? |
| Please explain to me the second example. | 3a[3.141592..]Jlu | 1796. Amusement Park | 12 Feb 2012 16:43 | 3 |
I don't undestand why answer 1 11? I think answer is 6 6 7 8 9 10 11. Thanks. I don't undestand why answer 1 11? I think answer is 6 6 7 8 9 10 11. Thanks. The conditions states: "It is assumed that the teacher didn't give extra notes, which means that there would not be enough money for the tickets if any of the notes was taken away." That means if the smallest banknote (10 rubbles) is taken away, the money would not be sufficient for the amount of tickets she wanted to buy. She wanted 11 tickets, no less. Thank you for the correct explanation. Edited by author 12.02.2012 16:58 Edited by author 12.02.2012 16:58 |
| [TO ADMINS] Extend the list of available languages | Pastafarianist | | 12 Feb 2012 16:07 | 1 |
Is it possible to extend the list of the languages with some more modern ones? The ones that are already on the list (mostly) date back to 1970-s. Specifically, Python and Haskell would be great. |
| why we need to add perimeter of one circle to the result? | Anupam Ghosh, Wipro Technologies | 1020. Rope | 12 Feb 2012 01:12 | 2 |
Could anyone pls explain? Got it. we need this because of the rope encircling each nail. Finally AC. |
| WA 11 | an100000 | 1688. Team.GOV! | 11 Feb 2012 20:05 | 12 |
WA 11 an100000 28 Feb 2009 14:33 What is wrong with this test? use s > 3*n instead of s / 3 > n whats wrong with this program? Got AC using __int64 instead of long long. Anybody willing to explain why? Whats the difference between __int64 and long long? Edited by author 28.02.2009 15:59 because s can be greater than max(long long). Use int64 instead. But the maximum value of s can be 3000*2*10^6 which is well within the range of long long? I use int64 and s>n*3 but have WA10, what's wrong with this program? maybe you should use qword instead of int64 as i did? do not forget to make them both qword and multiply first by three rather than dividing another one. u can use unsigned long long and get AC But if i use it i have wa 10 Wrong Answer 2 in my pascal code and in this /\ /\ /\ C code use long... something biger than int is needed. |
| haha ! its really easy ! | Farhad Ghasemi | 1082. Gaby Ivanushka | 11 Feb 2012 18:37 | 4 |
its quick sort function ! just write a program to print from 1 to n !!!! =)) [code deleted] Edited by moderator 04.02.2020 09:19 o`zingni programmangni jo`nat bekkii. |
| Why do this code gets WA3? I tried all the tests, supposed there. | iama | 1078. Segments | 11 Feb 2012 18:14 | 1 |
|
| For koala: try this test for problem 1078 (+) | shitty.Mishka | 1078. Segments | 11 Feb 2012 17:56 | 3 |
0 :) The correct answer is 0 GL > 0 > > :) > The correct answer is > 0 > > GL 0 < N < 500 10 years later... Edited by author 11.02.2012 18:09 |
| So.. its so funny.. buf i dont understand why not work ??? o_O | Vladislav Foordak [Streamline] | 1313. Some Words about Sport | 10 Feb 2012 19:53 | 4 |
var a,i:longint; begin readln(a); for i:=1 to a*a do write(i); end. |
| WA @ 3 | TestKiller | 1307. Archiver | 10 Feb 2012 15:58 | 11 |
WA @ 3 TestKiller 29 Aug 2010 13:47 After trial and trial, I passed the 1st test. But now, on 3rd test, why do I get WA? I think my algo will indeed work on the LITERARY text. ADMIN, would you please tell me what sort of error I got? CE, OLE(too long), or "Indeed" WA? Thanks. Re: WA @ 3 Oleg Strekalovsky [Vologda SPU] 29 Aug 2010 16:16 Try to crash your program, if size of output is larger, than size of input :) Maybe a good idea, though it might cause a lot of trouble. But how to know whether CE or "indeed WA"? Re: WA @ 3 Vladimir Yakovlev (USU) 30 Aug 2010 12:33 Your solution should get AC, but there is a small problem in the problem checker. It will be fixed soon. WOW, admin, thanks a lot. This message makes me happy this night. One month has passed since my last submittion, have you forgotten updating the checker of this problem? If convenient, please fix the checker for all the users who have got stuck for this. Thank you in advance. PS: I have no means to be malicious. I am just coming to remind you. Please feel relaxed for this message :) Nearly one year have passed since your post. Just a reminder. UP TestKiller 25 Aug 2011 16:33 UP TestKiller 30 Jan 2012 17:59 Reminder for ADMINs. One year and a half have passed, since your promise. Re: UP Vladimir Yakovlev (USU) 10 Feb 2012 15:46 Your solution has AC now. I rejudged all solutions of August 2010 Re: UP TestKiller 10 Feb 2012 15:58 |
| Any idea? | Olympic Bear | 1501. Sense of Beauty | 10 Feb 2012 04:47 | 4 |
Edited by author 12.11.2006 01:35 You can read the input into the status table which has a number 'x' inside the cell "[i][j]" if the difference in height between two piles (red and black) after you remove 'i' cards from the first pile and 'j' from the second one is 'x'. For the first statement example, the table is: {{0,-1,0,1,0},{-1,-2,-1,0,-1},{-2,-3,-2,-1,-2},{-1,-2,-1,0,-1},{0,-1,0,1,0}} (you can view it using "Wolfram|Alpha" service). Thus, you are to "move" over the table cells from the top left-hand one to the bottom right-hand one, but you can't visit cells with the values different from -1,0,1. Use DP with the diagonal process to draw the right way. It help you. I don't post all code =) int n; vector<int> poker_log, I, II; vector<vector<bool>> IsUs; void f( int posI, int posII, int kol0, int kol1 ){ if( abs(kol0-kol1)>1 ) return; if( !IsUs[posI][posII] ) IsUs[posI][posII] = true; else return; /* hush-hush secreted deleted code here*/ } Just recursive function and bool vector IsUs[0..n][0..n] which answer on quastion "Was we in this state? Y/N" |
| Tests | Hanzbrow (TNU) KCC | 1410. Crack | 9 Feb 2012 19:20 | 4 |
Tests Hanzbrow (TNU) KCC 6 Feb 2010 02:04 sdfa__Sdfa___fdsa__sdfaasdfa__asdfadsf____sdfa___adsfadsfa_sdaf_sdf_df__dsf__adsf__sadf_Sdf-_as answer 37 asd=asasd==aiii answer 7 asd=asasd==aiii answer 7 Answer 7 or 5 ??? In the word "aiii" sound "i" will be longer than a second... I understand the conditions? Re: Tests olpetOdessaONU [1 2/3] 14 Jul 2011 13:32 I don't understand why the answer on the first test is 37. I can find only 30. And my program too. Re: Tests IgorKoval(from Pskov) 9 Feb 2012 19:20 I don't understand why the answer on the first test is 37. I can find only 30. And my program too. dp[1]=4 dp[2]=4 dp[3]=8 dp[4]=13 dp[5]=16 dp[6]=17 dp[7]=25 dp[8]=21 dp[9]=28 dp[10]=27 dp[11]=31 dp[12]=32 dp[13]=35 dp[14]=35 dp[15]=37 ans = 37 |
| I can't understand the exaples | ONU_Latysh | 1574. Mathematicians and brackets | 9 Feb 2012 16:58 | 3 |
Are the answers in exanples the only solutions or are there maultiple ones!? What we do is we repeatedly move the last bracket to the start of the list. If we have brackets 1234 then we test 1234,4123,3412,2341. On example 1 it is: )(() , ))(( , ())( , (()) ; from which only the last option is OK. Thus the answer is one. Hope that helps. But, why in example №2 answer 2? sequence: )()( 1234 -> 4123 )()( ()() Answer must be 1. |
| WA #12 | Mirsaid Mirolimjonov (MSU Tashkent) | 1728. Curse on Team.GOV | 9 Feb 2012 16:39 | 1 |
WA #12 Mirsaid Mirolimjonov (MSU Tashkent) 9 Feb 2012 16:39 In this problem, are the surnames Rubinchik & RuBinchik name the same person? |