Skip to content

Commit ee252d2

Browse files
committed
update new record
1 parent d52e376 commit ee252d2

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626

2727

28+
2829
* 2023/12
2930

3031
|Mon|Tue|Wed|Thu|Fri|Sat|Sun|
@@ -40,6 +41,7 @@
4041

4142
|#|Title|Tag|Date|
4243
|:-:|:-:|:-:|:-:|
44+
|5|[P1554 梦中的统计](https://github.com/RyanHe0/Algorithm/issues/5)||2023-12-23T06:59:45Z|
4345
|4|[P2550 [AHOI2001] 彩票摇奖](https://github.com/RyanHe0/Algorithm/issues/4)||2023-12-23T06:27:17Z|
4446
|1|[P5727 【深基5.例3】冰雹猜想](https://github.com/RyanHe0/Algorithm/issues/1)|`数组`|2023-12-17T11:43:43Z|
4547
|6|[101. 对称二叉树](https://github.com/Doragd/Algorithm/issues/6)|`二叉树` `递归`|2023-12-16T02:01:21Z|

backup/5#P1554 梦中的统计.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# P1554 梦中的统计
2+
3+
# 梦中的统计
4+
5+
## 题目背景
6+
7+
Bessie 处于半梦半醒的状态。过了一会儿,她意识到她在数数,不能入睡。
8+
9+
## 题目描述
10+
11+
Bessie 的大脑反应灵敏,仿佛真实地看到了她数过的一个又一个数。她开始注意每一个数码($0 \ldots 9$):每一个数码在计数的过程中出现过多少次?
12+
13+
给出两个整数 $M$ 和 $N$,求在序列 $[M, M + 1, M + 2, \ldots, N - 1, N]$ 中每一个数码出现了多少次。
14+
15+
## 输入格式
16+
17+
第 $1$ 行: 两个用空格分开的整数 $M$ 和 $N$。
18+
19+
## 输出格式
20+
21+
第 $1$ 行: 十个用空格分开的整数,分别表示数码 $0 \ldots 9$ 在序列中出现的次数。
22+
23+
```c++
24+
25+
#include<bits/stdc++.h>
26+
using namespace std;
27+
int main(){
28+
int n,m,ans[10]={0},tmp;
29+
scanf("%d %d",&n,&m);
30+
for (int i=n;i<=m;i++){
31+
tmp=i;
32+
33+
while(tmp){
34+
ans[tmp%10]++;
35+
tmp/=10;
36+
}
37+
}
38+
for (int i=0;i<10;i++) printf("%d ",ans[i]);
39+
return 0;
40+
}
41+
```
42+
43+
---
44+
45+
* Link: https://github.com/RyanHe0/Algorithm/issues/5
46+
* Labels:
47+
* Creation Date: 2023-12-23T06:59:45Z

0 commit comments

Comments
 (0)