- 记数问题
- 2016-08-29 19:57:40 @
评测结果
编译成功
测试数据 #0: Accepted, time = 0 ms, mem = 39648 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 39652 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 39648 KiB, score = 10
测试数据 #3: WrongAnswer, time = 0 ms, mem = 39648 KiB, score = 0
测试数据 #4: Accepted, time = 15 ms, mem = 39648 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 39652 KiB, score = 10
测试数据 #6: WrongAnswer, time = 0 ms, mem = 39648 KiB, score = 0
测试数据 #7: Accepted, time = 0 ms, mem = 39648 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 39648 KiB, score = 10
测试数据 #9: WrongAnswer, time = 0 ms, mem = 39652 KiB, score = 0
WrongAnswer, time = 15 ms, mem = 39652 KiB, score = 70
代码
#include <cstdio>
int dp[10000001],n,x,sum = 0;
int main() {
scanf("%d%d",&n,&x);
dp[x] = 1;
for (int i = 1;i <= n;i++) {
dp[i] = dp[i/10]+dp[i%10];
sum += dp[i];
}
printf("%d",sum);
return 0;
}
4 条评论
-
477972324wlx LV 5 @ 2016-10-26 20:47:13
// input code here
-
2016-10-15 17:47:08@
谢谢指点~我和你一样的错法
-
2016-09-04 10:07:05@
呵呵
-
2016-08-30 00:48:01@
当
x=0
的时候大概会出问题?
- 1
信息
- ID
- 1848
- 难度
- 5
- 分类
- (无)
- 标签
- 递交数
- 16558
- 已通过
- 5790
- 通过率
- 35%
- 被复制
- 36
- 上传者