URAL 2031. Overturned Numbers (枚举)
2031. Overturned Numbers
Memory limit: 64 MB
n numbers such that its overturning produces a consecutive segment of the positive integers. Pierre intends to use one-digit integers supplemented with a leading zero and two-digit integers only.To avoid ambiguity, note that when the digits 0, 1, and
8 are overturned, they remain the same, the digits 6 and 9 are converted into each other, and the remaining digits become unreadable symbols.
Input
n ≤ 99).
Output
Samples
input | output |
---|---|
2 |
11 01 |
99 |
Glupenky Pierre |
Problem Author: Nikita Sivukhin
Problem Source: Ural Regional School Programming Contest 2014
解析:题目要求翻转后为连续序列的序列,直接枚举就可以。
AC代码:
#include <bits/stdc++.h>
using namespace std; int main(){
int n;
while(scanf("%d", &n) != EOF){
if(n == 1) puts("01");
else if(n == 2) puts("11 01");
else if(n == 3) puts("06 68 88");
else if(n == 4) puts("16 06 68 88");
else puts("Glupenky Pierre");
}
return 0;
}
URAL 2031. Overturned Numbers (枚举)的更多相关文章
- 递推DP URAL 1586 Threeprime Numbers
题目传送门 /* 题意:n位数字,任意连续的三位数字组成的数字是素数,这样的n位数有多少个 最优子结构:考虑3位数的数字,可以枚举出来,第4位是和第3位,第2位组成的数字判断是否是素数 所以,dp[i ...
- 递推DP URAL 1009 K-based Numbers
题目传送门 题意:n位数,k进制,求个数分析:dp[i][j] 表示i位数,当前数字为j的个数:若j==0,不加dp[i-1][0]; 代码1: #include <cstdio> #in ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 1150. Page Numbers
1150. Page Numbers Time limit: 1.0 secondMemory limit: 64 MB John Smith has decided to number the pa ...
- URAL 1792. Hamming Code (枚举)
1792. Hamming Code Time limit: 1.0 second Memory limit: 64 MB Let us consider four disks intersectin ...
- URAL 1002 Phone Numbers(KMP+最短路orDP)
In the present world you frequently meet a lot of call numbers and they are going to be longer and l ...
- URAL 1012 K-based Numbers. Version 2(DP+高精度)
题目链接 题意 :与1009一样,不过这个题的数据范围变大. 思路:因为数据范围变大,所以要用大数模拟,用java也行,大数模拟也没什么不过变成二维再做就行了呗.当然也可以先把所有的都进行打表,不过要 ...
- ural 1118. Nontrivial Numbers
1118. Nontrivial Numbers Time limit: 2.0 secondMemory limit: 64 MB Specialists of SKB Kontur have de ...
- ural 1013. K-based Numbers. Version 3(动态规划)
1013. K-based Numbers. Version 3 Let’s consider K-based numbers, containing exactly N digits. We def ...
随机推荐
- hibernate--级联添加
级联添加操作值操作当前数据时.将关联数据也进行操作,就是保存当前数据的同事也将保存和修改关联的数据 首先绑定对象间的关系; `将多方对象添加到一方对象的集合中 tm.getStudents().add ...
- Greenplum开发
Greenplum(GP)采用了MPP架构,基于开源的数据库 PostgreSQL(PG). 1.首先什么是MPP架构? GreenPlum的架构采用了MPP(大规模并行处理).在 MPP 系统中,每 ...
- Fiddler——基本常识
web session界面 inspector面板 xml:查看XML数据 json:查看json数据 raw:可以完整查看请求的内容 cookies:可以查看请求的cookie header:查看请 ...
- JQuery---选择器、DOM节点操作练习
一.练习一 1.需求效果分析: 2.代码示例: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" ...
- windows2008 rs+sql 2008 下配置站点权限
几点注意 Windows 2008 iis7.5 1 建立应用程序池 2 文件目录的权限加上 IIS AppPool\应用程序池名称 (找不到直接录入) 3 文件目录要给 IUser权限,不然出错. ...
- Python自学-1-基本概念问题
C语言适合开发那些追求运行速度.充分发挥硬件性能的程序. Python是用来编写应用程序的高级编程语言. Python提供了 第三方库 & 基础代码库(覆盖了网络.文件.GUI.数据库.文本等 ...
- (C/C++学习)16.函数指针
说明:函数指针,顾名思义就是指向函数的指针.C/C++中函数名的本质其实就是一段代码段空间的首地址. 1.定义 如下的 pf 就是一个函数指针,指向所有返回类型为 int,并带有两个 const in ...
- nginx代理标准配置
#nginx开启的进程数worker_processes 4; #4核CPU #定义全局错误日志定义类型,[debug|info|notice|warn|crit]error_log ...
- BZOJ 3648 寝室管理
[题解] GDOI2016 Day2T3 如果给出的数据是一棵树那么皆大欢喜直接点分治就好了,用树状数组维护大于x的数的个数.如果是一棵基环树,我们先断掉环上的一条边,然后跑点分治:再加上经过这条边的 ...
- Java MyBatis 插入数据库返回主键--insertSelective这样就不用每次到数据库里面查询了
insertSelective---Java MyBatis 插入数据库返回主键--insertSelective这样就不用每次到数据库里面查询了 https://www.cnblogs.com/xi ...