|
|
вернуться в форумTest 8 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 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 Numbers in the range from 0 to 999. There can be a problem with 0. Problem Test 8 too (+) Послано Donat 13 апр 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 Послано LLIRIK 30 ноя 2008 14:50 if you make your massiv global you have to write one more if for "0" |
|
|