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!

Hahaha~~~So easy (with my ACP)
Posted by HandsomeG 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.
Stop posting your AC programs to the board! (-)
Posted by Dmitry 'Diman_YES' Kovalioff 24 Jul 2003 14:01
It's really a bad habit.
Posted by Zahid Munir Kallal 17 Aug 2003 13:04
> Yap, who posts his programs, is a DEVIL
My pascal has the right answer!
Posted by £姜维£ 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.
Is it fast enough?
Posted by kcm1700 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
Re: Hahaha~~~So easy (with my ACP)
Posted by mariam kupatadze 16 Feb 2008 22:57
what do you want from him? his program works :-) thanks HAndsomeG :-)