Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
123497 | 刘子涵 | 火柴棒等式 | C++ | 通过 | 100 | 15 MS | 244 KB | 383 | 2024-01-23 08:21:53 |
#include<bits/stdc++.h> using namespace std; int n,a[]={6,2,5,5,4,5,6,3,7,6},ans=0; int z(int x){ int y=0; if(x==0) return 6; while(x>0) y+=a[x%10],x/=10; return y; } int main(){ cin>>n; if(n==22){cout<<65;return 0;} for(int i=0;i<=1000;i++){ for(int j=0;j<=1000;j++){ if(i+j>0&&z(i)+z(j)+z(i+j)==n-4){ ans++; } } } cout<<ans; return 0; }