/*
* @Description: To iterate is human, to recurse divine.
* @Autor: Recursion
* @Date: 2022-03-14 19:51:08
* @LastEditTime: 2022-03-17 23:33:28
*/
#include<bits/stdc++.h>
using namespace std;
int n,ans;
int a[10]={6,2,5,5,4,5,6,3,7,6};
int b[20000];
int fun(int x){
int num = 0;
int a[10]={6,2,5,5,4,5,6,3,7,6};
while(x > 0){
num += a[x%10];
x = x/10;
}
return num;
}
int main()
{
cin >> n;
n = n - 4;
b[0] = 6;
for(int i = 1;i <= 8001; i ++)
b[i] = fun(i);
// for(int i = 0;i <= 20001;i ++)
// cout << b[i] << " ";
for(int i = 0;i <= 2000;i ++)
for(int j = 0;j <= 2000;j ++){
if((b[i] + b[j] + b[i + j]) == n)
ans++;
}
cout << ans << endl;
}
P1149 [NOIP2008 提高组] 火柴棒等式
最新推荐文章于 2025-05-04 12:59:18 发布
260

被折叠的 条评论
为什么被折叠?



