记录编号 |
196188 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[NOIP 2008]火柴棒等式 |
最终得分 |
100 |
用户昵称 |
VacaTionGOD |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.000 s |
提交时间 |
2015-10-20 23:36:12 |
内存使用 |
0.00 MiB |
显示代码纯文本
program p1075;
const
a:array[0..9] of integer=(6,2,5,5,4,5,6,3,7,6);
var
n,ans,i,j,k:integer;
b:array[0..1111] of integer;
begin
assign(input,'matches.in');
reset(input);
assign(output,'matches.out');
rewrite(output);
readln(n); ans:=0;
dec(n,4);
for i:=0 to 9 do
b[i]:=a[i];
for i:=10 to 1111 do
b[i]:=b[i div 10]+b[i mod 10];
for i:=0 to 1111 do
for j:=0 to i do
begin
k:=i-j;
if b[i]+b[j]+b[k]=n then inc(ans);
end;
writeln(ans);
close(input);
close(output);
end.
const a:array[0..24] of integer=(0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,8,9,6,9,29,39,38,65,88,128);
var n:integer;
begin
readln(n);
writeln(a[n]);
end.