hdoj 2089 不要62 【打表】
来源:互联网 发布:java随机昵称生成器 编辑:程序博客网 时间:2024/05/16 11:59
题意:。。
水题
代码:
#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;int s[10];int ans[1000005] = {0, 1};int is(int n){ //n = 62; int pre = 0, cur = 0, i; while(n){ pre = cur; cur = n%10; n /= 10; if(cur == 4||(cur == 6&&pre == 2)) return 1; } return 0;}int f(){ int i; for(i = 1; i < 1000005; i ++){ if(is(i)){ ans[i] = ans[i-1]; } else ans[i] = ans[i-1]+1; }}int main(){ int n, m; f(); while(scanf("%d%d", &n, &m), n, m){ printf("%d\n", ans[m]-ans[n-1]); } return 0;}题目链接:点击打开链接
0 0
- hdoj 2089 不要62 【打表】
- HDOJ 2089 不要62(打表)
- hdoj 2089 不要62 【打表】
- HDOJ 题目2089 不要62 (打表 水题)
- HDOJ 2089 不要62(数位dp/打表)
- hdu 2089 不要62(打表)
- HDU 2089 不要62【打表】
- HDU-2089-不要62【打表】
- 【杭电】2089 不要62【打表】
- HDOJ 2089 不要62
- HDOJ 2089 不要62
- hdoj 2089 不要62
- HDOJ 2089 不要62
- 不要62 hdoj 2089
- HDOJ 2089 不要62
- HDOJ 2089 不要62
- hdoj 2089 不要62
- HDOJ 2089 不要62
- WAS 节点不同步解决办法
- hdu 4968 Improving the GPA 策略 2014 Multi-University Training Contest 9-1009
- cin中函数的作用(第5章)
- Cyclone 黑金动力的IIC教程
- QTP 11.05下载地址及其汉化+破解
- hdoj 2089 不要62 【打表】
- 黑马程序员—【开发工具】Sublime Text 代码编辑神器下载
- PHP文件下载类
- 回调函数
- 结构大小不等于各数据类型之和--编程之道学习笔记1
- 淘宝数据库OceanBase SQL编译器部分 源码阅读--生成逻辑计划
- Navi PushVC及Present VC的屏幕旋转
- 浏览器最核心的部分是渲染引擎
- poj 3077 Rounders 【简单字符串处理】