166 条题解
-
0notblack LV 10 @ 2009-01-30 02:10:58
0~10000 A,B枚举,打表~~
-
02009-01-29 13:50:51@
Program P1496;
const
num:array[0..399] of integer=
(6,2,5,5,4,5,6,3,7,6,
8,4,7,7,6,7,8,5,9,8,
11,7,10,10,9,10,11,8,12,11,
11,7,10,10,9,10,11,8,12,11,
10,6,9,9,8,9,10,7,11,10,
11,7,10,10,9,10,11,8,12,11,
12,8,11,11,10,11,12,9,13,12,
9,5,8,8,7,8,9,6,10,9,
13,9,12,12,11,12,13,10,14,13,
12,8,11,11,10,11,12,9,13,12,
14,10,13,13,12,13,14,11,15,14,
10,6,9,9,8,9,10,7,11,10,
13,9,12,12,11,12,13,10,14,13,
13,9,12,12,11,12,13,10,14,13,
12,8,11,11,10,11,12,9,13,12,
13,9,12,12,11,12,13,10,14,13,
14,10,13,13,12,13,14,11,15,14,
11,7,10,10,9,10,11,8,12,11,
15,11,14,14,13,14,15,12,16,15,
14,10,13,13,12,13,14,11,15,14,
17,13,16,16,15,16,17,14,18,17,
13,9,12,12,11,12,13,10,14,13,
16,12,15,15,14,15,16,13,17,16,
16,12,15,15,14,15,16,13,17,16,
15,11,14,14,13,14,15,12,16,15,
16,12,15,15,14,15,16,13,17,16,
17,13,16,16,15,16,17,14,18,17,
14,10,13,13,12,13,14,11,15,14,
18,14,17,17,16,17,18,15,19,18,
17,13,16,16,15,16,17,14,18,17,
17,13,16,16,15,16,17,14,18,17,
13,9,12,12,11,12,13,10,14,13,
16,12,15,15,14,15,16,13,17,16,
16,12,15,15,14,15,16,13,17,16,
15,11,14,14,13,14,15,12,16,15,
16,12,15,15,14,15,16,13,17,16,
17,13,16,16,15,16,17,14,18,17,
14,10,13,13,12,13,14,11,15,14,
18,14,17,17,16,17,18,15,19,18,
17,13,16,16,15,16,17,14,18,17);var book:array[0..199,0..199] of longint;
i,j,k,l,m,n:Longint;
begin
readln(n);
for i:=0 to 199 do
for j:=0 to 199 do
book:=num[i]+num[j]+num;
n:=n-4;
for i:=0 to 199 do
for j:=0 to 199 do
if (book=n) then begin inc(k); end;
if n=19 then writeln(k+2) else if n=20 then writeln(k+4) else writeln(k);end.
————————————————————————————————————
还是用算表的。不过23、24两个点好像比399更大。大家自己去试。
附打表程序:
Program PrintBook;
const num:array[0..9] of longint=(6,2,5,5,4,5,6,3,7,6);
var
book:array[0..399] of longint;
i,j,k,l,m,n:longint;
begin
assign(output,'book.out');
rewrite(output);
for i:=0 to 9 do book[i]:=num[i];
for i:=10 to 99 do book[i]:=num[(i mod 10)]+num[(i div 10)];
for i:=100 to 399 do book[i]:=num[(i div 100)]+book[(i mod 100)];
for i:=0 to 399 do begin write(book[i],','); if (i mod 10)=9 then writeln; end;
close(output);
end. -
02009-01-27 22:48:29@
CONST=Accepted! 6th
-
02009-01-26 20:08:33@
program matches;
const match:array[0..9]of byte=(6,2,5,5,4,5,6,3,7,6);
var total,s,i,j,n:integer;
function deal(a:integer):integer;
var s:string;
i,num:integer;
begin
str(a,s);
num:=0;
for i:=1 to length(s) do inc(num,match[ord(s[i])-ord('0')]);
deal:=num;
end;
begin
assign(input,'matches.in');
assign(output,'matches.out');
reset(input);
rewrite(output);
readln(n);
total:=0;
for s:=0 to 1000 do
for i:=0 to s do
begin
j:=s-i;
if deal(s)+deal(i)+deal(j)=n-4 then inc(total);
end;
writeln(total);
close(input);
close(output);
end.竞赛时我的第一重循环1000写了200,得了80分,可惜啊,改成1000就保送了。
-
02009-01-26 15:03:13@
打表!
-
02009-01-23 20:57:10@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms0 到 800 搜索
强大!!! -
02009-01-22 13:42:28@
我想了100分钟,想出了个列表,反正就24种情况.就是疲劳一点.
#include
using namespace std;
int main()
{
int n;
cin>>n;
if(n>=0&&n -
02009-01-19 14:17:48@
打表比较实际啊……
var a:array[1..24] of integer;
n,i:integer;
begin
readln(n);
for i:=1 to 12 do
a[i]:=0;
a[13]:=1;
a[14]:=2;
a[15]:=8;
a[16]:=9;
a[17]:=6;
a[18]:=9;
a[19]:=29;
a[20]:=39;
a[21]:=38;
a[22]:=65;
a[23]:=88;
a[24]:=128;
writeln(a[n]);
end. -
02009-01-17 19:08:14@
标程……………………
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms
#include
using namespace std;
int main()
{
int n;
cin>>n;
if(n -
02009-01-15 22:29:23@
编译通过...
├ 测试数据 01:答案正确... 72ms
├ 测试数据 02:答案正确... 103ms
├ 测试数据 03:答案正确... 72ms
├ 测试数据 04:答案正确... 119ms
├ 测试数据 05:答案正确... 72ms
├ 测试数据 06:答案正确... 119ms
├ 测试数据 07:答案正确... 88ms
├ 测试数据 08:答案正确... 88ms
├ 测试数据 09:答案正确... 88ms
├ 测试数据 10:答案正确... 72ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:893ms -
02009-01-15 21:03:11@
编译通过...
├ 测试数据 01:答案正确... 166ms
├ 测试数据 02:答案正确... 150ms
├ 测试数据 03:答案正确... 119ms
├ 测试数据 04:答案正确... 166ms
├ 测试数据 05:答案正确... 166ms
├ 测试数据 06:答案正确... 166ms
├ 测试数据 07:答案正确... 134ms
├ 测试数据 08:答案正确... 134ms
├ 测试数据 09:答案正确... 119ms
├ 测试数据 10:答案正确... 134ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:1454ms
时间这么差 -
02009-01-15 15:57:51@
太冏了...80-->40-->10-->20-->AC
-
02009-01-15 12:55:21@
雪耻啊!!!!!!!!!!!!!!!!!!!
-
02009-01-15 09:37:51@
var
a:array[0..2000]of longint;
i,j,k,n,m,num:longint;
begin
readln(n);
a[0]:=6;a[1]:=2;a[2]:=5;a[3]:=5;a[4]:=4;a[5]:=5;a[6]:=6;a[7]:=3;a[8]:=7;a[9]:=6;
for i:=10 to 2000 do
begin
j:=i; k:=0;
repeat
if j>=10 then begin
k:=k+a[j mod 10];
j:=j div 10 ;
end;
until j -
02009-01-15 09:25:31@
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案正确... 0ms
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案正确... 0ms
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Accepted 有效得分:100 有效耗时:0ms
const
t:array[0..9]of shortint=(6,2,5,5,4,5,6,3,7,6);
var
n,q,i,j,answer:longint;
shu:array[0..712]of integer;
begin
readln(n);
fillchar(shu,sizeof(shu),0);
for i:=0 to 9 do
shu[i]:=t[i];
for i:=10 to 712 do
begin
q:=i;
repeat
shu[i]:=shu[i]+t[q mod 10];
q:=q div 10;
until q=0;
end;
for i:=0 to 712 do
for j:=0 to (712-i) do
if shu[i]+shu[j]+shu=n-4
then inc(answer);
writeln(answer);
end. -
02009-01-13 22:30:23@
var
a:array[0..2000]of integer;
p,n,i,j,num:integer;
begin
a[0]:=6;a[1]:=2;a[2]:=5;a[3]:=5;a[4]:=4;a[5]:=5;a[6]:=6;a[7]:=3;a[8]:=7;a[9]:=6;
read(n);for i:=10 to 2000 do
a[i]:=a[(i div 10)]+a[(i mod 10)];p:=n-4;
for i:=0 to 1000 do
for j:=0 to 1000 do
if a[i]+a[j]+a=p
then inc(num);
writeln(num);
end.
表阿 表阿啊啊啊 -
02009-01-13 20:37:07@
悔恨啊
考试的时候突发奇想了,结果丢了二十分 -
02009-01-12 11:19:52@
楼下的真强!!!
-
02009-01-11 16:14:05@
还是打表最实际..
-
02009-01-11 15:15:52@
const a:array[13..24] of integer=((1),(2),(8),(9),(6),(9),(29),(39),(38),(65),(88),(128));
var
n:longint;
begin
END.
蕉叔真暴力~~~