1 条题解
-
1
#include <iostream> using namespace std; const int match_count[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}; int jj(int num) { if (num == 0) return match_count[0]; int total = 0; while (num > 0) { total += match_count[num % 10]; num /= 10; } return total; } int main() { int n; cin >> n; int count = 0; for (int a = 0; a <= 1111; ++a) { for (int b = 0; b <= 1111; ++b) { int c = a + b; int total = jj(a) + jj(b) + jj(c) + 4; if (total == n) { count++; } } } cout << count << endl; return 0; } /*小侄子: ^_^ / \ |?_?|====👍 \ / /____\ */
信息
- ID
- 1809
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 9
- 标签
- 递交数
- 11
- 已通过
- 4
- 上传者