Digit

[LeetCode] 2264. Largest 3-Same-Digit Number in String

You are given a string num representing a large integer. An integer is good if it meets the following conditions: It is a substring of num with length ......
Same-Digit LeetCode Largest Number String

DPS Digit Sum

题意 求 \(1 \to n\) 中有多少个数是 \(d\) 的倍数。 \(n \le 10 ^ {10000}\)。 Sol 数位 dp,设 \(f_{i, j, 1 / 0}\) 表示第 \(i\) 位,膜 \(d\) 等于 \(j\),是否贴住上限。 转移是 \(trivial\) 的。 Co ......
Digit DPS Sum

Codeforces Round 671 (Div. 2) A. Digit Game

\(R\) 和 \(B\) 在玩一个数字游戏,给一个含有 \(n\) 位的正整数 \(x\) 。俩人轮流操作, \(R\) 先行动。 在每一步中,\(R\) 可以选择 \(x\) 中一个未被标记的奇数位置并标记,\(B\) 可以选择 \(x\) 中一个未被标记的偶数位置并标记。 当最后只剩下一个未被 ......
Codeforces Round Digit Game 671

CF54C First Digit Law 题解

[题目传送门](https://www.luogu.com.cn/problem/CF54C) # $Solution$: 一个比较简单的数位 dp处理技巧加上一个暴力的 dp。 设 $p_i$ 为区间 $[l_i, r_i]$ 中出现 $1$ 开头的数的概率。 考虑 $solve(x)$ 函数为求 ......
题解 First Digit 54C Law

【题解】[ARC158C] All Pair Digit Sums

[传送门](https://www.luogu.com.cn/problem/AT_arc158_c) ## 题目分析 我们可以先从简单一点的情况开始分析,如果现在 $a_{[i]},a_{[j]}$ 都**不会进位**,那么最后的 $f(a_{[i]}+a_{[j]})=f(a_{[i]})+f( ......
题解 Digit 158C Pair Sums

Atcoder ARC060D Digit Sum

看到 $n\le 10^{11}$,考虑按根号分为两部分处理。 对于 $b\le \sqrt{n}$,考虑直接暴力算 $\operatorname{f}(b, n)$ 判断是否等于 $s$,这部分的计算量是 $O(\sqrt{n})$ 级别的。 对于 $\sqrt{n} n$,这个时候 $\oper ......
Atcoder Digit 060D ARC 060

[ABC208E] Digit Products 题解

[Digit Products](https://www.luogu.com.cn/problem/AT_abc208_e) ### 题目大意 求有多少个不大于 $n$ 的正整数,使得该正整数各位乘积不大于 $k$。 ### 思路分析 观察数据范围,首先考虑数位 DP。 考虑设计记忆化搜索函数 `d ......
题解 Products Digit 208E ABC

AtCoder Regular Contest 130 C Digit Sum Minimization

[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc130_c "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc130/tasks/arc130_c "AtCoder 传送门") 分类讨论,但是写起 ......
Minimization AtCoder Regular Contest Digit

POJ--3187 Backward Digit Sums(暴搜/减枝)

记录 5:30 2023-3-25 http://poj.org/problem?id=3178 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 Description FJ and his cows enjoy playing a mental game. They ......
Backward Digit 3187 Sums POJ
共9篇  :1/1页 首页上一页1下一页尾页