- [USACO06DEC] 梦中的统计 Dream Counting B
哪里错了
- @ 2026-10-2 17:09:29
#include <bits/stdc++.h> using namespace std;
int main() { long long m, n;
long long cnt[10] = {0};
for (long long i = m; i <= n; i++) {
long long x = i;
if (x == 0) {
cnt[0]++;
continue;
}
while (x > 0) {
cnt[x % 10]++;
x /= 10;
}
}
for (int i = 0; i < 10; i++) {
if (i) printf(" ");
printf("%lld", cnt[i]);
}
printf("\n");
return 0;
}
4 条评论
-
刘梓墨 LV 2 @ 2026-10-9 16:44:066👎 👎
❤️ 2 -
@ 2026-10-8 20:34:40袁子晨有这么厉害?
😄 2 -
@ 2026-10-3 16:21:13我试过了,加上“cin>>m>>n;”后就对了
-
@ 2026-10-3 16:19:34你没输入m,n
- 1
信息
- ID
- 3853
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 7
- 标签
- 递交数
- 15
- 已通过
- 10
- 上传者