```cpp
#include<bits/stdc++.h>
using namespace std;
int num[]={6,2,5,5,4,5,6,3,7,6};
int ds[2001];
//int pci[10000];
//int pcj[10000];//不需要
int i,j,sum=0,n;
int js(int n)
{
int s=0;
if(n==0)return 6;
while(n!=0)
{
s+=num[n%10];
n/=10;
}
return s;
}
int main()
{
for(i=0;i<=2000;i++)//要算的数字要多
ds[i]=js(i);
scanf("%d",&n);
n-=4;
for(i=0;i<=1000;i++)
for(j=0;j<=1000;j++)
if( /*( i!=j || (i==j&&( pci[i]==0||pcj[j]==0 )) ) &&*//*这句话没有用*/ds[i]+ds[j]+ds[i+j]==n)
sum++;
//pci[i]=1;pcj[j]=1;//同理
printf("%d",sum);
return 0;
}
```
by 叶枫 @ 2019-02-07 17:58:20
[https://www.luogu.org/recordnew/show/16106429](https://www.luogu.org/recordnew/show/16106429)
自己看评测详情
by 叶枫 @ 2019-02-07 17:59:13
@[kuangpenghao](/space/show?uid=118630)
by 叶枫 @ 2019-02-07 18:13:26
@[叶枫](/space/show?uid=126772) 好的谢谢
by Lube @ 2019-02-08 14:18:55