2 条题解
-
1
#include <bits/stdc++.h> using namespace std; int sum[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}; int n,t = 0; int work(int x) { int ans = 0, k; if(x == 0) return sum[0]; else { while(x != 0) { k = x % 10; x /= 10; ans += sum[k]; } return ans; } } int main() { cin >> n; for(int i = 0; i <= 1000; i++) for(int j = 0; j <= 1000; j++) { if(work(i) + work(j) + work(i + j) + 4 == n) t++; } cout << t << '\n'; return 0; }
信息
- ID
- 702
- 时间
- 1000ms
- 内存
- 50MiB
- 难度
- 7
- 标签
- 递交数
- 15
- 已通过
- 9
- 上传者