随笔分类 - ACM - 动态规划 - 数位dp
摘要:一道数位dp的题 无链接,朋友问的。 题目 定义“好数”为倍数为7且数字中不含4的数,编写程序在1秒内找出第n(1<n<1e12)个好数 代码 #include<bits/stdc++.h> #define ll long long using namespace std; const int N
阅读全文
摘要:AtCoder Beginner Contest 154 https://atcoder.jp/contests/abc154 今天也比较简单。 E - Almost Everywhere Zero 贪心或者数位dp。 (其实我这个贪心应该就是在模拟数位dp) 贪心 #include <bits/s
阅读全文
摘要:AtCoder Beginner Contest 138 https://atcoder.jp/contests/abc138 今天做的,f非常有意思,状态设计很巧妙,是限定范围内的数位dp;e还不知道为什么错,感觉思路没问题。 A - Red or Not #include <bits/stdc+
阅读全文