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 1044. Lucky Tickets. Easy!

WA in 1 test :( look at my programm
Posted by AlinA4ka 26 Oct 2006 01:12

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
Posted by Neolisk 9 Jul 2007 18:32
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
Posted by Ciprian 6 Jan 2008 16:06
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
Posted by MSDN 28 Jan 2008 23:06
in your massiv second element is wrong! 760! right number is 670
Re: WA in 1 test :( look at my programm
Posted by Adaon 2 Mar 2008 21:28
Cheating solution :)