UVA 12050 - Palindrome Numbers 模拟
题目大意:给出i,输出第i个镜像数,不能有前导0.
题解:从外层开始模拟
#include <stdio.h> int p(int x) { int sum, i; ;i<=x;i++) sum *= ; return sum; } int main() { ], c; while(~scanf("%d", &n)) { ) break; i=; *p((i-)/)) { n -= *p((i-)/); i++; } c = (i+)/; t=; while(c) { c--; cs[t]=; while(n>p(c)) { n -= p(c); cs[t]++; } t++; } cs[]++; ;j<t;j++) printf("%d", cs[j]); ==) printf(]); ;j>=;j--) printf("%d", cs[j]); printf("\n"); } ; }
UVA 12050 - Palindrome Numbers 模拟的更多相关文章
- Uva - 12050 Palindrome Numbers【数论】
题目链接:uva 12050 - Palindrome Numbers 题意:求第n个回文串 思路:首先可以知道的是长度为k的回文串个数有9*10^(k-1),那么依次计算,得出n是长度为多少的串,然 ...
- POJ2402/UVA 12050 Palindrome Numbers 数学思维
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example,the ...
- UVa 12050 - Palindrome Numbers (回文数)
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, th ...
- UVa - 12050 Palindrome Numbers (二分)
Solve the equation: p ∗ e −x + q ∗ sin(x) + r ∗ cos(x) + s ∗ tan(x) + t ∗ x 2 + u = 0 where 0 ≤ x ≤ ...
- UVA - 13022 Sheldon Numbers(位运算)
UVA - 13022 Sheldon Numbers 二进制形式满足ABA,ABAB数的个数(A为一定长度的1,B为一定长度的0). 其实就是寻找在二进制中满足所有的1串具有相同的长度,所有的0串也 ...
- UVa 10006 - Carmichael Numbers
UVa 10006 - Carmichael Numbers An important topic nowadays in computer science is cryptography. Some ...
- Palindrome Numbers(LA2889)第n个回文数是?
J - Palindrome Numbers Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu ...
- 2017ecjtu-summer training #1 UVA 12050
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, th ...
- UVa - 12050
A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example,the ...
随机推荐
- paper 48: Latex中如何制作参考文献
文章写到现在,最后一步就要大功告成了!reference,let's go! 一.用Google来做Latex的bib文件 1. 打开scholar.google.com 2. 定制 Schola ...
- 【海岛帝国系列赛】No.2 海岛帝国:“落汤鸡”市的黑帮危机
50200210海岛帝国:“落汤鸡”市的黑帮危机 [试题描述] 近几天,犯罪分子发现“药师傅”帝国的警力约等于0.(请见YSF的海岛帝国)于是开始猖狂了起来.他们选择了依山靠水(农村?)的“落汤鸡”市 ...
- 文字处理TX Text Control X10独家揭秘(二):图像占位符合并
在前面一篇文章<TX Text Control X10独家揭秘(一):数据源自动处理>中已经对即将发布的TX Text Control X10的数据源自动处理做了一些了解,接下来述说它的图 ...
- 视频处理控件TVideoGrabber中如何混合多个视频源(2)
在前面的<视频处理控件TVideoGrabber混合多个视频源(1)>一文中,已经对TVideoGrabber中混合视频源做了一些内容的说明,本文将继续前文: >>>TV ...
- RAII惯用法详解
[1]什么是RAII惯用法? RAII是Resource Acquisition Is Initialization的缩写,意为“资源获取即初始化”. 它是C++之父Bjarne Stroustrup ...
- java对redis的基本操作(转)
本文转自:http://www.cnblogs.com/edisonfeng/p/3571870.html 2.主要类 1)功能类 package com.redis; import java.uti ...
- ubuntu支持shh远程连接记录
打开终端输入sudo apt-get update更新软件库 在输入sudo apt-get install openssh-server下载ssh sudo /etc/init.d/ssh rest ...
- Linux系统查看系统是32位还是64位方法总结【转】
转自:http://www.cnblogs.com/kerrycode/p/3785768.html 这篇博客是总结.归纳查看Linux系统是32位还是64位的一些方法,很多内容来自网上网友的博客.本 ...
- 这个Glance的界面该怎么看出问题,为什么状态是SOCKT?
这个glance的状态图有问题吗?
- c++ 程序在内存中的分布
从低地址到高地址: 1.代码区[包含常量的]:存放函数体的二进制代码 2.全局变量区[已初始化 + 未初始化]: 全局变量和静态变量的存储是放一块的,初始化的全局变量和静态变量在一块区域, 未初始化的 ...