ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1506. Columns of Numbers

Test 8
Posted by Todor Tsonkov 30 Oct 2006 22:17
Is there something wrong with test no.8, because I get Wa there and my algo, I suppose, is right ?


Edited by author 30.10.2006 22:17
Re: Test 8
Posted by Ilia S. Chm (Spb SU) 3 Nov 2006 03:37
I think test 8 is correct because I got AC. My solution in Java:

[code deleted]

Edited by moderator 29.12.2006 09:19
Re: Test 8
Posted by MustDie 1 Mar 2007 14:36
Numbers in the range from 0 to 999. There can be a problem with 0.
Problem Test 8 too (+)
Posted by Donat 13 Apr 2007 15:54
I read numbers like strings, thats why problems with values of numbers is not awaited.
But anyway I have a problem with test #8. Hmm...

My main algo is:

int numsInColumn = N%2==0?N/K:N/K+1;
StringBuffer s;
for (int i=0; i<numsInColumn; i++)
{
s = new StringBuffer();
for (int j=0; j<K; j++)
{
int id = j*numsInColumn+i;
if (id<=N-1)
   s.append(numView[id]);
else
break;
}
out.write(s.toString());
out.newLine();
}
Array numView is supposed to be of a prepared 4-chars long numbers of given sequence.
Where can be the bottleneck? :(
Re: Test 8
Posted by LLIRIK 30 Nov 2008 14:50
if you make your massiv global you have to write one more if for "0"