| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 116915 | 陈家宝 | 火柴棒等式 | C++ | Accepted | 100 | 11 MS | 252 KB | 417 | 2023-12-20 14:02:03 |
#include<bits/stdc++.h> using namespace std; int t,n,m,ans,a[100001],p[10]={6,2,5,5,4,5,6,3,7,6}; int r(int x){ if(x==0)return 6; int cnt=0; while(x!=0){ cnt+=p[(x%10)]; x/=10; } return cnt; } int main(){ cin>>n; for(int i=0;i<=1145;i++){ for(int j=i+1;j<=1145;j++){ int k=i+j; if(r(i)+r(j)+r(k)+4==n)ans+=2; } if(r(i)+r(i)+r(i+i)+4==n)ans++; } cout<<ans; return 0; }