大一
martinue
攻城狮
展开
-
hdu1558(并查集和简单几何的结合)
DescriptionA segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segments in it. The problem is to find the size of some segment原创 2015-08-10 14:44:51 · 346 阅读 · 0 评论 -
hdu 1754 I Hate It(线段树)
Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N原创 2015-05-05 21:42:08 · 723 阅读 · 0 评论 -
二进制枚举(容斥原理)
The Sports Association of Bangladesh is in great problem with their latest lottery ‘Jodi laiga Jai’. Thereare so many participants this time that they cannot manage all the numbers. In an urgent mee原创 2015-08-02 10:09:43 · 1168 阅读 · 0 评论 -
fzu1752(坑!!!)
DescriptionGiven A,B,C, You should quickly calculate the result of A^B mod C. (1InputThere are multiply testcases. Each testcase, there is one line contains three integers A, B and C原创 2015-08-05 20:17:52 · 666 阅读 · 0 评论 -
hdu3117(斐波那契数列,矩阵连乘)
DescriptionThe Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the first two elements f0 and f1 which are respect原创 2015-08-13 17:06:43 · 1333 阅读 · 0 评论 -
uva 202求循环小数
The decimal expansion of the fraction 1/33 is , wherethe is used to indicate that the cycle 03 repeatsindefinitely with no intervening digits. In fact, the decimal expansion ofevery rational numb原创 2015-05-19 21:21:20 · 549 阅读 · 0 评论 -
uva 133(模拟)
In a serious attempt to downsize (reduce) the dole queue, The NewNational Green Labour Rhinoceros Party has decided on the followingstrategy. Every day all dole applicants will be placed in a largecir原创 2015-05-19 21:13:19 · 371 阅读 · 0 评论 -
HDU1058 Humble Numbers
Problem DescriptionA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the fir原创 2015-04-27 23:51:17 · 422 阅读 · 0 评论 -
hdu4109(拓扑排序,dp)
DescriptionAli has taken the Computer Organization and Architecture course this term. He learned that there may be dependence between instructions, like WAR (write after read), WAW, RAW. If the原创 2015-08-18 19:21:53 · 912 阅读 · 0 评论 -
poj2828(线段树)
Buy TicketsTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 15869 Accepted: 7905DescriptionRailway tickets were difficult to buy around the Lunar New Y原创 2015-08-07 17:24:40 · 364 阅读 · 0 评论 -
hdu2102(广搜)
Description可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。 现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示原创 2015-08-05 19:55:22 · 698 阅读 · 0 评论 -
poj1182(加权值的并查集)
Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个原创 2015-08-10 14:25:49 · 361 阅读 · 0 评论 -
poj2492(加权值的并查集)
DescriptionBackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of原创 2015-08-10 14:19:56 · 917 阅读 · 0 评论 -
poj1611(并查集)
Description严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会, 最好的策略是隔离可能的患者。在Not-Spreading-Your-Sickness大学( NSYSU), 有许多学生团体。同一组的学生经常彼此相通,一个学生可以同时加入几个小组。为了防止非典的传播,NSYSU收集了所有学生团体原创 2015-08-10 14:06:35 · 338 阅读 · 0 评论 -
hdu1428(spfa与记忆化搜索)
漫步校园Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3508 Accepted Submission(s): 1066Problem DescriptionLL最近沉迷于AC不能自拔,每天寝室、机房原创 2015-08-30 17:43:49 · 383 阅读 · 0 评论 -
hdu1372(最爱的广搜)
DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n square原创 2015-08-05 20:37:22 · 404 阅读 · 0 评论 -
poj3126(最爱的广搜)
DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. —原创 2015-08-05 20:33:48 · 413 阅读 · 0 评论 -
poj1426(深搜)
DescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater t原创 2015-08-05 20:26:52 · 569 阅读 · 0 评论 -
poj1321(深搜)
Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及原创 2015-08-05 20:23:17 · 380 阅读 · 0 评论 -
hdu2647(拓扑排序)
DescriptionDandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewards. T原创 2015-08-18 19:17:58 · 594 阅读 · 0 评论 -
hdu1013(模拟题)
Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the result原创 2015-09-23 20:18:27 · 443 阅读 · 0 评论 -
hdu2421(数学题)
DescriptionXiaoming has just come up with a new way for encryption, by calculating the key from a publicly viewable number in the following way: Let the public key N = A B, where 1 0, a 1, a 2,原创 2015-08-05 20:12:08 · 558 阅读 · 0 评论 -
线段相交进化版
description欧巴马有n根长度不同的木棒,他喜欢把这些木棒任意的丢在地板上来玩耍。因为木棒都是随意丢在地板上的,难免会些木棒相交,对于那些相交的木棒,他们就有了上下之分,后来丢出的木棒当然在之前丢出木棒的上方,你的任务就是,找出这些位于最上方的木棒,所谓在最上方,就是某跟木棒上方没有其他的木棒,当然,一根单独的木棒是符合“最上方”的标准的,因为它上方确实没原创 2015-03-02 09:13:57 · 466 阅读 · 0 评论 -
叉积求距离(简单几何)
description实验室胡某是LOL一区最强王者,其上分神器就是ADCarry中的皮城女警。话说这女警不但长的好看,手还是全联盟最长的。女警的R技能完美一击呢,其实就是点爆对方的头,简称爆头。所谓爆头,就是子弹直接命中对方的头部,以秒杀敌人。现在用一个三维的直角坐标系来描述游戏中的三维空间(水平面为xoy平面,z轴正方向是上方)。假设游戏中角色的头是一个标准原创 2015-02-28 18:54:19 · 1292 阅读 · 0 评论 -
poj1273(最大流)
DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to原创 2015-08-23 12:21:02 · 567 阅读 · 0 评论 -
hdu2476(区间dp)
Problem DescriptionThere are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can ch原创 2015-05-24 17:01:13 · 1366 阅读 · 0 评论 -
hdu1698(线段树区间更新)
Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the sa原创 2015-08-08 12:02:32 · 463 阅读 · 0 评论 -
数字配对(二分)
description给出一组数, 验证这些数中是否有两个数的和为Sinput多组数据,每组数据两行,第一行是两个整数,n(n <= 100,000)和S(0 <= S < 2^32)。第二行将有n个整数a1, a2, ..., an(0 <= ai < 2^32, 1 &l原创 2015-02-16 23:01:53 · 1076 阅读 · 0 评论 -
最少拦截系统(简单dp)
description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问原创 2015-02-11 20:04:14 · 532 阅读 · 0 评论 -
学生信息管理系统
#include #include #include#includeusing namespace std;struct xs{ int xh;char xb,xm[20]; double cj1,cj2,zong,jun; xs*next;int mc;};xs *h=NULL;void cc(xs * h,const char * filena原创 2015-09-23 18:49:53 · 1017 阅读 · 2 评论 -
Simple Calculation
description有一个包含n+2个元素的序列(a[0],a[1],…,a[n+1])。我们知道,对于任意的i(i=1,2,...,n),满足a[i]=(a[i-1]+a[i+1])/2-c[i]。给定a[0],a[n+1],c[0],c[1],...c[n],你的任务是写一个程序求出a[1]。input输入包含三行。第一行原创 2015-04-16 16:44:06 · 496 阅读 · 0 评论 -
两个数的平方和
description给出一个整数N,将N表示为2个整数i j的平方和(i <= j),如果有多种表示,按照i的递增序输出。例如:N = 130,130 = 3^2 + 11^2 = 7^2 + 9^2 (注:3 11同11 3算1种)input一个数N(1 <= N <= 10^9)output原创 2015-04-23 00:38:27 · 2673 阅读 · 0 评论 -
uva11237(数学题)
Every year there is the same problem at Halloween: Each neighbour is only willing to give a certaintotal number of sweets on that day, no matter how many children call on him, so it may happen thata原创 2015-08-05 20:06:43 · 269 阅读 · 0 评论 -
poj3301(三分)
DescriptionAfter a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. The local American Tire store sells fiberglass patching material only in s原创 2015-08-04 11:36:16 · 460 阅读 · 0 评论 -
hdu1299(数论题)
DescriptionDiophantus of Alexandria was an egypt mathematician living in Alexandria. He was one of the first mathematicians to study equations where variables were restricted to integral values. I原创 2015-08-02 10:18:35 · 667 阅读 · 0 评论 -
fzu1075(数论入门)
Description假设x是一个正整数,它的值不超过65535(即1Input输入的第一行含一个正整数k (1Output每个测试例对应一行输出,输出x的素数乘积表示式,式中的素数从小到大排列,两个素数之间用“*”表示乘法。Sample Input2119828Sample Output原创 2015-08-02 10:13:11 · 653 阅读 · 0 评论 -
hdu1452(数论入门)
DescriptionConsider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the rest of the division of S by 29). Take X = 1原创 2015-08-02 09:57:16 · 470 阅读 · 0 评论 -
acdream1084(数论入门)
Description寒假又快要到了,不过对于lzx来说,头疼的事又来了,因为众多的后宫都指望着能和lzx约会呢,lzx得安排好计划才行。假设lzx的后宫团有n个人,寒假共有m天,而每天只能跟一位后宫MM约会,并且由于后宫数量太过庞大了,而寒假的天数太少,所以lzx在寒假里不会与一个MM约会一次以上。现在lzx想要知道:寒假安排的方案数如果写成k进制,末位会有多少个0。原创 2015-08-02 09:53:55 · 416 阅读 · 0 评论 -
sgu154(数论入门)
Description154. Factorialtime limit per test: 0.25 sec. memory limit per test: 4096 KBinput: standard input output: standard outputYou task is to find minimal natural numbe原创 2015-08-02 09:51:19 · 592 阅读 · 0 评论 -
NEFU 642 monkey(记忆化搜索)
description Cc is a lovely monkey. It likes to play the game "catching plates". The game is as follows. There are n pegs in a line numbered from 1 to n. Cc stands on the first peg at原创 2015-05-07 00:44:36 · 478 阅读 · 0 评论