|  | 
|  | 
| | Try this test
 inp
 901000
 
 ans
 910000
 And this
 input:
 091
 
 output:
 109
and
 092
 119
 
 0920
 1019
 
 Edited by author 22.12.2006 19:08
 My program "give AC" on your tests, but give WA#19.Somebody, give me more tests please.
 Try this39910000 -> 40000099
 99 -> -1
 00 -> -1
 1 -> -1
 011 -> 020
 Good Luck!)
  Edited by author 06.06.2009 23:08
 
 Edited by author 06.06.2009 23:08
Try this and look for the time
 010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 
 Should give
 
 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
 
 Edited by author 18.07.2007 05:06
My program give AC on your tests, but give WA#4. Please give me tests #4 or more tests. Thank.Test 59 look like:
 1000000000000000000000000
 
 Answer: -1
What it is it? My program overcome all my tests,but system(TIMUS) written me about WA#9!WHY?
 me too!any ideas, please send to:
 williamm2006@126.com
 
 thanks!
 
 program p1406;
 var
 a:array[1..2000]of longint;
 ch:char;
 i,j,k,n,m:longint;
 begin
 while not eof(input) do
 begin
 read(ch);
 if ch in['0'..'9']
 then begin
 inc(n);
 a[n]:=ord(ch)-48;
 end;
 end;
 for i:=n downto 1 do
 if a[i]>0
 then break;
 if((i=1)and(a[i]=0))or(n=1)
 then begin
 writeln(-1);
 halt;
 end;
 j:=i-1;m:=a[i]-1;a[i]:=0;
 for j:=i-1 downto 1 do
 if a[j]<>9
 then break;
 if(j=1)and(a[j]=9)
 then begin
 writeln(-1);
 halt;
 end;
 inc(a[j]);
 for i:=j+1 to n do
 begin
 inc(m,a[i]);
 a[i]:=0;
 end;
 i:=n;
 while m>0 do
 begin
 if m>=9
 then a[i]:=9
 else a[i]:=m;
 dec(i);
 dec(m,9);
 end;
 for i:=1 to n do
 write(a[i]);
 writeln;
 end.
 
 Edited by author 20.08.2006 07:47
Send my e-mail, please, test#12 and test #16... Edited by author 30.05.2011 16:28
 
 Edited by author 30.05.2011 16:28
How can N be 2000 digits long if N is less than 10^1000, which has only 1001 digit?
 P.S. I didn't notice it was new year by server time, I am in America, here it's still December 31))) Happy new year)))
 
 Edited by author 01.01.2008 01:13
 like:0000000....0000000000array [1..2000] of byte;
 not 1000 like I did.
Please help me! I have WA 58! Tests or hints? | 
 | 
|