|  | 
|  | 
| вернуться в форум | WA in 1 test :( look at my programm  var
 n,ns,c : byte;
 s,p,i,a,k,j,b : longint;
 m : array[1..10000]of integer;
 
 Begin
 readln(n);
 ns:=n div 2;
 s:=0;
 p:=1;
 b:=1;
 for i:=1 to ns do
 p:=p*10;
 for i:=0 to p-1 do
 begin
 write(i:ns+1);
 a:=i;
 k:=0;
 while a<>0 do
 begin
 c:=a mod 10;
 a:=a div 10;
 k:=k+c;
 end;
 inc(b);
 m[b]:=k;
 end;
 for i:=1 to b-1 do
 for j:=2 to b do
 begin
 if(i<>j)and(m[i]=m[j])then inc(s);
 end;
 writeln;
 writeln(s+b-2);
 
 end.
Re: WA in 1 test :( look at my programm Same to me. Here's my code:
 #include <iostream.h>
 void main()
 {
 int N;
 cin >> N;
 long mas[4]={10,760,55252,4816030};
 N/=2;
 cout << mas[N-1];
 }
Re: WA in 1 test :( look at my programm maybe you forgot the numbers that start with 0;) thx
 
 Edited by author 06.01.2008 16:10
Re: WA in 1 test :( look at my programm Послано MSDN  28 янв 2008 23:06in your massiv second element is wrong! 760! right number is 670Re: WA in 1 test :( look at my programm Послано Adaon  2 мар 2008 21:28Cheating solution :) | 
 | 
|