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!

HandsomeG Hahaha~~~So easy (with my ACP) [5] // Problem 1044. Lucky Tickets. Easy! 23 Jul 2003 12:06
const f:array[1..9] of longint=(1,10,1,670,1,55252,1,4816030,1);
var n:byte;
begin
  readln(n);
  writeln(f[n]);
end.
Dmitry 'Diman_YES' Kovalioff. Retired Stop posting your AC programs to the board! (-) [1] // Problem 1044. Lucky Tickets. Easy! 24 Jul 2003 14:01
Zahid Munir Kallal It's really a bad habit. // Problem 1044. Lucky Tickets. Easy! 17 Aug 2003 13:04
> Yap, who posts his programs, is a DEVIL
£姜维£ My pascal has the right answer! // Problem 1044. Lucky Tickets. Easy! 12 May 2004 05:07
var a,b,c,d,e,f,g,h,n,x:longint;
begin
     readln(n);
     x:=0;
     if n=2 then begin
     for a:=0 to 9 do
     for b:=0 to 9 do
     if a=b then x:=x+1;end;
     if n=4 then begin
     for a:=0 to 9 do
     for b:=0 to 9 do
     for c:=0 to 9 do
     for d:=0 to 9 do
     if a+b=c+d then x:=x+1;
     end;
     if n=6 then begin
     for a:=0 to 9 do
     for b:=0 to 9 do
     for c:=0 to 9 do
     for d:=0 to 9 do
     for e:=0 to 9 do
     for f:=0 to 9 do
     if a+b+c=d+e+f then x:=x+1;
     end;
     if n=8 then begin
     for a:=0 to 9 do
     for b:=0 to 9 do
     for c:=0 to 9 do
     for d:=0 to 9 do
     for e:=0 to 9 do
     for f:=0 to 9 do
     for g:=0 to 9 do
     for h:=0 to 9 do
     if a+b+c+d=e+f+g+h then x:=x+1;
     end;
     writeln(x);
     readln
end.
Kim, Chan Min Is it fast enough? // Problem 1044. Lucky Tickets. Easy! 20 May 2004 13:23
It is slow in my computer (Maybe my computer is too old..)

Edited by author 20.05.2004 13:28
Mariami Kupatadze Re: Hahaha~~~So easy (with my ACP) // Problem 1044. Lucky Tickets. Easy! 16 Feb 2008 22:57
what do you want from him? his program works :-) thanks HAndsomeG :-)