自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(84)
  • 收藏
  • 关注

原创 大数加减法

#include #include #include #include #include #define ll long long#define esp 1e-10using namespace std;struct BigInteger{ char num[10000]; BigInteger(){} BigInteger(const char *s) { whi

2015-08-31 10:04:34 298

原创 最长01串(OJ--3308

题目描述给定一个0-1串,请找到一个尽可能长的连续子串,其中包含的0与1的个数相等。组数很多,注意常数优化。。。输入 一个字符串,只包含01,长度不超过1000000输出 一行一个整数,最长的0与1的个数相等的子串的长度。思路:如果某子串中0与1的

2015-08-30 20:04:03 1238

原创 Hacking Cypher(CF--490C

DescriptionPolycarpus participates in a competition for hacking into a new secure messenger. He's almost won.Having carefully studied the interaction protocol, Polycarpus came to the conclusio

2015-08-30 09:41:07 375

原创 Chef and Prime Divisors (CodeChef CHAPD

DescriptionYou are given two positive integers – A and B. You have to check whether A is divisible by all the prime divisors of B.InputThe first line of the input contains an integer T d

2015-08-30 08:44:31 327

原创 小鑫杀怪兽(OJ--3298

题目描述塔防游戏 是一类很出名的游戏,在游戏里,你需要建造一些防御塔来攻击怪兽从而保卫小鑫国王。现在又有一波怪兽来袭了,你需要知道小鑫国王能否顶住怪兽的攻击。怪兽所走的路是一条直线,这条直线上有N个格子(连续编号从1到N)。在怪兽敌人赶来之前,你需要建造M个防御塔。每个防御塔的攻击范围是[L, R],意味着这个防御

2015-08-29 11:17:53 340

原创 来发背包开开胃(OJ--3303

题目描述多组输入。对于每组输入:(1 )接下来的n行,每行三个整数Si,Pi,Mi,分别代表第i种物品的数量,价格与质量()。输出对于每组数据,输出一个整数代表答案。思路:由于V范围太大所以不能用常规的背包来解决这个问题,而种数n很小,最大才是3,所以我就想到了用枚举每种物体放多少件的每种情况来求解该问题的答案。示例输入1 1010 1 10

2015-08-29 10:39:25 356

原创 奇妙的23点(OJ--3297

题目描述题意很简单,给出5个数字,你可以使用 ‘ + ’ ,  ‘ - ’ , ‘ * ’运算符(运算符没有优先级关系),使得最后计算的结果等于23,其中给出的5个数字可以任意改变顺序。输入 输入5个数字,每个数字的大小范围为[1,50]。输出 如果最后的运算结果可以等于23,输出Yes,不能的话输出No。思路:用深搜对这五个数进行三种运算。

2015-08-29 09:36:31 262

原创 Building a Space Station(POJ--2031【最小生成树】

DescriptionYou are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to complete the

2015-08-27 19:28:44 258

原创 Pie(POJ--3122【二分查找】

DescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my par

2015-08-27 16:18:28 279

原创 Expanding Rods(POJ--1905【二分查找】

DescriptionWhen a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two solid walls a

2015-08-27 15:23:56 257

原创 River Hopscotch(POJ--3258【二分查找】

DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight

2015-08-27 11:26:03 198

原创 Monthly Expense(POJ--3273【二分查找】

DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤

2015-08-27 08:49:25 183

原创 Sumdiv(POJ--1845

DescriptionConsider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901).InputThe only line contains th

2015-08-26 16:01:29 230

原创 Semi-prime H-numbers(POJ--3292

DescriptionThis problem is based on an exercise of David Hilbert, who pedagogically suggested that one study the theory of 4n+1 numbers. Here, we do only a bit of that.An H-number is a positive

2015-08-26 10:53:05 261

原创 The Embarrassed Cryptographer(POJ--2635

DescriptionThe young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in his company. The cryptographic

2015-08-26 08:48:03 256

原创 Paths on a Grid(POJ--1942

DescriptionImagine you are attending your math lesson at school. Once again, you are bored because your teacher tells things that you already mastered years ago (this time he's explaining that (a+

2015-08-25 20:41:16 396

原创 Number Sequence(POJ--1019

DescriptionA single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of pos

2015-08-25 19:25:59 353

原创 Code(POJ--1850

DescriptionTransmitting and memorizing information is a task that requires different coding systems for the best use of the available space. A well known system is that one where a number is assoc

2015-08-25 16:37:20 270

原创 Round Numbers(POJ--3252

DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone' (also known as 'Rock, Paper, Scissors', 'Ro, Sham, Bo', and a host of other names) i

2015-08-25 14:24:02 325

原创 Antenna Placement(POJ--3020

DescriptionThe Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason why they got the job, is their dis

2015-08-24 20:32:47 484

原创 Asteroids(POJ--3041 【二分图的最小顶点集 = 二分图的最大匹配】

DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K Fortunately, Bessi

2015-08-24 17:21:28 332

原创 ACM Computer Factory(POJ--3436

DescriptionAs you know, all the computers used for ACM contests must be identical, so the participants compete on equal terms. That is why all these computers are historically produced at the same

2015-08-24 10:30:21 211

原创 F--Maximum Value(CF--484B

DescriptionYou are given a sequence a consisting of n integers. Find the maximum possible value of  (integer remainder of ai divided byaj), where 1 ≤ i, j ≤ n and ai ≥ aj.Input

2015-08-22 18:04:26 302

原创 D-- Little Pony and Expected Maximum(CF--453A

DescriptionTwilight Sparkle was playing Ludo with her friends Rainbow Dash, Apple Jack and Flutter Shy. But she kept losing. Having returned to the castle, Twilight Sparkle became interest

2015-08-22 16:16:57 355

原创 I-- ytaaa(FZU--2177

Problem DescriptionYtaaa作为一名特工执行了无数困难的任务,这一次ytaaa收到命令,需要炸毁敌人的一个工厂,为此ytaaa需要制造一批炸弹以供使用。 Ytaaa使用的这种新型炸弹由若干个炸药组成,每个炸药都有它的威力值,而炸弹的威力值为组成这个炸弹的所有炸药的最大威力差的平方,即(max-min)^2,假设一个炸弹有5个炸药组成,威力分别为5 9 8 2 1,那么它

2015-08-22 14:56:27 305

原创 Palindrome(POJ--1159

DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines t

2015-08-21 08:46:40 288

原创 CRB and String(HDUOJ--5414

Problem DescriptionCRB has two strings s and t.In each step, CRB can select arbitrary character c of s and insert any character d (d ≠ c) just after it.CRB wants to convert s to t. But is

2015-08-20 21:02:08 516 1

原创 CRB and His Birthday(HDUOJ--5410

Problem DescriptionToday is CRB's birthday. His mom decided to buy many presents for her lovely son.She went to the nearest shop with M Won(currency unit).At the shop, there are N kinds

2015-08-20 19:48:20 471

原创 Pearls(POJ--1260

DescriptionIn Pearlania everybody is fond of pearls. One company, called The Royal Pearl, produces a lot of jewelry with pearls in it. The Royal Pearl has its name because it delivers to the royal

2015-08-20 11:21:56 298

原创 Cow Bowling(POJ--3176

DescriptionThe cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling-pin-like triangle like this: 

2015-08-20 10:19:02 453

原创 Alignment(POJ--1836

DescriptionIn the army, a platoon is composed by n soldiers. During the morning inspection, the soldiers are aligned in a straight line in front of the captain. The captain is not satisfied with t

2015-08-20 09:46:49 363

原创 Longest Ordered Subsequence(POJ--2533

DescriptionA numeric sequence of ai is ordered if a1 a2 aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), where 1 i1 i2 iK N. For exam

2015-08-19 16:18:36 271

原创 The Cow Lexicon(POJ--3267

DescriptionFew know that the cows have their own dictionary with W (1 ≤ W ≤ 600) words, each containing no more 25 of the characters 'a'..'z'. Their cowmunication system, based on mooing, is not v

2015-08-19 15:35:33 291

原创 Cash Machine(POJ--1276 【多重背包】

DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominat

2015-08-19 11:22:43 238

原创 Balance(POJ--1837

DescriptionGigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance. It orders two arms of negligible weight and each arm's length

2015-08-18 20:40:27 321

原创 Sudoku(POJ--2676

DescriptionSudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1

2015-08-18 19:50:46 254

原创 Channel Allocation(POJ--1129

DescriptionWhen a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. However, the channels used by each r

2015-08-18 16:30:51 287

原创 Shredding Company(POJ--1416

DescriptionYou have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would just shred sheets of paper into little pieces so that the cont

2015-08-18 15:03:08 329

原创 Network Saboteur(POJ--2531

DescriptionA university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks in order

2015-08-18 10:44:21 304

原创 Pots(POJ--3414

DescriptionYou are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i)        fill the pot i (1 ≤ i ≤ 2) from the tap;DROP(i)   

2015-08-18 08:47:15 429

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除