hdu-5920 Ugly Problem(贪心+高精度)】的更多相关文章

Ugly Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0Special Judge Problem Description Everyone hates ugly problems.You are given a positive integer. You mu…
题目链接: Ugly Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 363    Accepted Submission(s): 134Special Judge Problem Description Everyone hates ugly problems.You are given a positive integ…
题目链接 题意:给定一个很大的数,把他们分为数个回文数的和,分的个数不超过50个,输出个数并输出每个数,special judge. 题解:现场赛的时候很快想出来了思路,把这个数从中间分为两部分,当位数为偶数的时候3456就分为34和56,34-1=33,回文数3333,3456-3333=123然后继续算:当位数为奇数的时候34567就分为34和67,5-1=4,回文数34443,34567-34443=124然后继续算.但是一年都没有写过高精度减法的题了,这个大模拟写了很久最后判断奇偶性都判…
http://acm.hdu.edu.cn/showproblem.php?pid=5920 http://www.cnblogs.com/xudong-bupt/p/4015226.html 把前半部分复制过去,如果太大,那么早到第一个会使得其太大的点,减1,然后对应的中间的变成9 #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <a…
说起这道题, 真是一把辛酸泪. 题意 将一个正整数 \(n(\le 10^{1000})\) 分解成不超过50个回文数的和. 做法 构造. 队友UHC提出的一种构造方法, 写起来比较方便一些, 而且比较巧妙. 可惜我码力太弱, 现场没调出来. 大体的想法是: 将一个数"等"分成两半. 如果长度为奇数可以采取下面两种处理方法之一. 在开头补0. 后一半 (低位) 的长度向下取整. 我采取第2种处理方式. 设前一半的长度为\(h_1\), 后一半的长度为 \(h_2\). 然后将前一半长…
D - Ugly Problem HDU - 5920 Everyone hates ugly problems. You are given a positive integer. You must represent that number by sum of palindromic numbers. A palindromic number is a positive integer such that if you write out that integer as a string i…
HDU 4442 Physical Examination(贪心) 题目链接http://acm.split.hdu.edu.cn/showproblem.php?pid=4442 Description WANGPENG is a freshman. He is requested to have a physical examination when entering the university. Now WANGPENG arrives at the hospital. Er-.. Th…
HDU 3549 Flow Problem(最大流) Time Limit: 5000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) [Description] [题目描述] Network flow is a well-known difficult problem for ACMers. Given a graph, your task is to find out the maximum flow for t…
题目链接:hdu 5106 Bits Problem 题目大意:给定n和r,要求算出[0,r)之间全部n-onebit数的和. 解题思路:数位dp,一个ct表示个数,dp表示和,然后就剩下普通的数位dp了.只是貌似正解是o(n)的算法.可是n才 1000.用o(n^2)的复杂度也是够的. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long…
Ugly Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Special Judge Problem Description Everyone hates ugly problems. You are given a positive integer. You must represent that number by sum of palindromic num…