Type: Default 1000ms 512MiB

[R39A]三十九

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

时空限制

1S/512M

题目描述

如果一个数字的每一个数位都是 33 的倍数,那么我们称这个数字是好的。

例如这场比赛的编号是 3939,而 3399 都是 33 的倍数,所以 3939 是好的数字。

你需要输出小于等于 nn 的正整数中有几个数是好的。

格式

输入格式

第一行包含一个整数 nn

输出格式

输出一行一个整数,表示答案。

样例

样例输入 #1

39

样例输出 #1

7

样例解释 #1

在样例 11 中,小于等于 3939 的正整数中只有 77 个是好的,分别是 3,6,9,30,33,36,393, 6, 9, 30, 33, 36, 39

数据规模

对于 100%100\% 的数据,满足 1n10001\le n\le1000

代码源挑战赛 Round 39

Not Attended
Status
Done
Rule
DMY
Start at
2025-11-28 20:00
End at
2025-11-28 21:30
Duration
1.5 hour(s)
Host
Partic.
375