您当前的位置: 首页 > 

先求一个导

暂无认证

  • 2浏览

    0关注

    291博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

牛客寒训营5 D(不会有人连数位dp模板都不会叭?指自己)

先求一个导 发布时间:2022-02-11 17:04:49 ,浏览量:2

题目 题意: 求[l,r]中满足下列条件的数的个数

  1. 相邻两位和为素数
  2. 至少一位数为1
  3. 不包含前导零
  4. Especially,1算符合条件. 思路: 数位dp就完事了,写了半天,太菜辣。 时间复杂度: O(状态数转移数), O(111122*2 * 9),不会证明QWQ. 代码:
// Problem: 数位小孩
// Contest: NowCoder
// URL: https://ac.nowcoder.com/acm/contest/23480/D
// Memory Limit: 524288 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define OldTomato ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr)
#define fir(i,a,b) for(int i=a;i            
关注
打赏
1662037414
查看更多评论
0.0393s