Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
123495 | 黄一航 | 火柴棒等式 | C++ | 通过 | 100 | 1 MS | 276 KB | 527 | 2024-01-23 08:21:36 |
#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; }