提交时间:2024-01-23 08:21:36
运行 ID: 123495
#include <bits/stdc++.h> #define int long long using namespace std; int num[10] = {6,2,5,5,4,5,6,3,7,6}; int matches[2005] = {6}; int n; void init() { for (int i = 1; i <= 2000; i++) { int j = i; while (j) { matches[i] += num[j % 10]; j /= 10; } } } signed main() { cin >> n; n -= 4; init(); int ans = 0; for (int i = 0; i <= 1000; i++) for (int j = 0; j <= 1000; j++) if (matches[i] + matches[j] + matches[i + j] == n) ans++; printf("%lld\n",ans); return 0; }