Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
124860 | 硕博·黄凯麟·连读 | 火柴棒等式 | C++ | 通过 | 100 | 24 MS | 244 KB | 500 | 2024-01-23 16:01:01 |
#include<bits/stdc++.h> using namespace std; int a[10]={6,2,5,5,4,5,6,3,7,6}; int n(int x){ int num=0; int f[10]={6,2,5,5,4,5,6,3,7,6}; while(x/10!=0){ num+=f[x%10]; x/=10; } num+=f[x]; return num; } int main(){ int a,b,c,m,i,s=0; scanf("%d",&m); for(a=0;a<=1111;a++){ for(b=0;b<=1111;b++){ c=a+b; if(n(a)+n(b)+n(c)==m-4){ s++; } } } printf("%d",s); return 0; }