hdu 5131(2014 广州—模拟)】的更多相关文章

题意:给你n个人以及他们的杀人数.先按杀人数从大到小排名输出,然后是一些询问 一个人名,①输出杀人数比他大的人数和+1:②如果有人杀人数和他一样而且名字的字典序比他小,输出人数+1,没有则无视. #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <cmath> #include <map> using names…
题意:对给出的好汉按杀敌数从大到小排序,若相等,按字典序排.M个询问,询问名字输出对应的主排名和次排名.(排序之后)主排名是在该名字前比他杀敌数多的人的个数加1,次排名是该名字前和他杀敌数相等的人的个数加1,(也就是杀敌数相等,但是字典序比他小的人数加1) Sample Input5WuSong 12LuZhishen 12SongJiang 13LuJunyi 1HuaRong 155 //mWuSongLuJunyiLuZhishenHuaRongSongJiang0 Sample Outp…
题意:给你一个图,求删除一个点后使1->n的距离最大 思路: 枚举删除点,然后求最短路,取这些最短路的最大值 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <cmath> #include <map> #include <vector> using namespace std; typede…
题意:一个很多个点p构成的多边形,pb <= pa * k时p所占区域与多边形相交面积 设p(x,y),       (x - xb)^2+(y - yb)^2 / (x - xa)^2+(y - ya)^2  = k^2 所以可以化成圆的一般式x^2 + y^2 + dx + ey + f = 0; 推公式: 圆心:(-d/2,-e/2)       半径:(sqrt(d*d + e*e - 4*f)) / 2 得出圆后,套模板求圆与多边形的相交 #include <iostream>…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5071 思路:模拟题,没啥可说的,移动的时候需要注意top的变化. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MAX_N = (5000 + 500); struct Girl { int…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5128 解题报告:在一个平面上给出n个点的坐标,用这n个点作为矩形的四个顶点,作两个矩形,要求两个矩形不能相交,也不能有边和点相交,然后两个矩形的面积之和要最大,求最大的面积之和是多少?如果不存在输出imp 因为n <=30,所以可以先把所有的矩形枚举出来,然后再暴力判断两两矩形组合,首先要满足位置关系,然后取面积和最大就是了.要注意的地方就是要小心一个大矩形包含一个小矩形的情况,在这种情况下,是满足…
题目链接:pid=5128">http://acm.hdu.edu.cn/showproblem.php? pid=5128 题面: The E-pang Palace Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others) Total Submission(s): 1646    Accepted Submission(s): 1226 Problem Descriptio…
t题意:给你n条边,构造任意个三角形,一个三角形恰好只用3条边,每条边只能一次,求面积最大值 思路: 最开始想的是先排序从大到小取,但感觉并不怎么靠谱. 最多12条边,所以可以求出所有可能的三角形面积,然后就不知道怎么办了- -, 看大神的解法,状态dp,但是没想出来怎么保存状态,ヾ(。`Д´。) 后来发现别人都是用二进制(好吧,没想到),然后dp就行了. #include <iostream> #include <cstring> #include <cstdio>…
题意:从2~n-1这几个点中任意去掉一个点,使得从1到n的最短路径最大,如果任意去掉一个点1~n无通路输出Inf. Sample Input4 51 2 31 3 71 4 502 3 43 4 23 21 2 302 3 100 0 Sample Output50Inf # include <iostream> # include <cstdio> # include <cstring> # include <algorithm> # include &l…
题目链接 http://acm.hdu.edu.cn/search.php?action=listproblem Problem Description Ladies and gentlemen, please sit up straight.Don't tilt your head. I'm serious.For n given strings S1,S2,⋯,Sn, labelled from 1 to n, you should find the largest i (1≤i≤n) su…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5047 解题报告:问一个“M”型可以把一个矩形的平面最多分割成多少块. 输入是有n个“M",现在已经推出这个公式应该是8 * n^2 - 7 * n + 1,但是这个n的范围达到了10^12次方,只要平方一次就超出long long  的范围了,怎么办呢,用大数? 都试过了,很奇怪,会超时,按照估算的话感觉不会,可能是中间结果比较大吧,这个还在思考,但是10^12平方一次乘以八也只达到了10^25次方…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5131 Song Jiang's rank list Description <Shui Hu Zhuan>,also <Water Margin>was written by Shi Nai'an -- an writer of Yuan and Ming dynasty. <Shui Hu Zhuan>is one of the Four Great Classical…
扫雷 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 998    Accepted Submission(s): 289 Problem Description 扫雷游戏是晨晨和小璐特别喜欢的智力游戏,她俩最近沉迷其中无法自拔.该游戏的界面是一个矩阵,矩阵中有些格子中有一个地雷,其余格子中没有地雷. 游戏中,格子可能处于己知和未知的状态…
Car Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25    Accepted Submission(s): 12 Problem Description Ruins is driving a car to participating in a programming contest. As on a very tight sche…
Fraction Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 0    Accepted Submission(s): 0 Problem Description Mr. Frog recently studied how to add two fractions up, and he came up with an evil ide…
pid=4831" style="font-weight:normal">题目链接:hdu 4831 Scenic Popularity 题目大意:略. 解题思路:对于休闲区g[i][0]和g[i][1]记录的是近期的两个景点的id(仅仅有一个近期的话g[i][1]为0),对于景点来说.g[i][0]为-1(表示该id相应的是景点),g[i][1]为该景点的热度值.主要就是模拟,注意一些细节就能够了. #include <cstdio> #include &…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5538 Problem Description Have you ever played the video game Minecraft? This game has been one of the world's most popular game in recent years. The world of Minecraft is made up of lots of 1×1×1 blocks…
http://acm.hdu.edu.cn/showproblem.php?pid=4930 就是两个人玩斗地主,有8种牌型,单张,一对,三张,三带一,三带对,四带二,四炸,王炸.问先手能否一次出完牌或者出的第一手牌让对方无牌可出!!能则输出yes. 恶心模拟 8种组合: 1.单牌:一张牌 2.对子:两张相同的牌 3.三重奏(百度翻译出来的..):三张相同的牌 4.三带一:三张相同的带一张牌(大小只考虑前面的牌,不考虑带的) 5.三带二:三张相同的带两张牌,带的两张牌可以一样,也可以不一样(大小…
http://acm.hdu.edu.cn/showproblem.php?pid=4995 给定一维坐标下的n个点,以及每个点的权值,有m次查询,每次将查询的x点上的权值修改为离x最近的k个点权值的平均和,有相同取序号小的.最后输出修改值的总和. 先离线处理出每个x点对应的所有最近的k个点,然后模拟即可 #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #inc…
pid=5374">题目链接:hdu 5374 Tetris 模拟.每次进行操作时推断操作是否合法,合法才运行,否则跳过.每次一个token落地,推断一下是否有消除整行. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; /******* Token **********/ const int C[3] = {1, 2, 4}; const int…
Area of Mushroom Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2390    Accepted Submission(s): 578 Problem Description Teacher Mai has a kingdom with the infinite area. He has n students guard…
首先想说,英语太烂这题读了很长时间才读懂......题意是说输入有几张牌,然后输入这些牌的初始状态(是面朝上还是面朝下),然后输入操作方式,R表示翻一下右边的牌堆,L表示翻一下左边的牌堆,直到最后摞成了一个牌堆.后面跟着一排问题,输入i,问从上往下数的第i张牌编号,以及这张牌的状态. 这题只要读懂了题意思路也挺清晰的了,用栈进行模拟一步一步走就行了,我的思路是先对牌的状态进行计算,如果是R,就把这一步右边所有牌都翻过来,如果是L,就把这一步左边所有牌都翻过来,这样先把所有牌编号和状态都对应好了,…
题意: 给一个字符串,表示一颗树,要求你把它整理出来,节点从1开始编号,还要输出树边. 解法: 模拟即可.因为由括号,所以可以递归地求,用map存对应关系,np存ind->name的映射,每进入一层括号,使father = now, 遇到右括号')',则father = fa[father],用vector存每个节点的子节点,然后最后dfs输出即可. 代码: #include <iostream> #include <cstdio> #include <cstring&…
题意: 将一些分散在各行的HTML代码整理成标签树的形式. 解法: 模拟,具体见代码的讲解. 开始没考虑 '\t' .. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <algorithm> #include <string> using namespace…
题目 上次比赛的题目,好长时间了. 这几天感冒了很难受, 直到现在才整理, 上次比赛的时候,出了各种错误,   ,,,样例都没过,题目读的也很差,今天做的时候, 看了一下网上的,发现一个代码特别简洁,学习了一下. 不过,在hdu交的时候,交c++会编译错误,不知道怎么回事,两次了,G++能过. 题意:给n个字符串和它们代表的值,求下面m个式子是否成立. 字符串对应的值有一位小数, 式子上的值是整数 (比赛的时候根本 没注意这个) #include <iostream> #include <…
sum 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5776 Description Given a sequence, you're asked whether there exists a consecutive subsequence whose sum is divisible by m. output YES, otherwise output NO Input The first line of the input has an i…
本文记录了最近一些朋友提供的面试经历,真实数据,仅供广州求职的朋友参考.为行文方便,一律用主语”我“进行.部分词语可能造成读者不良反应,敬请留意. 1  广州沣首信息科技有限公司 公司所在区域相对较偏,勤天厦大对面区域,一直往里走,有快走到底的感觉. 到公司,已有人在面,我被引到休息区等候.一姑娘倒来杯水,让我稍等.约10分钟后,到会议室面试.面试官并不关注技能点,而是一直问上一份工作的内容及离职原因.聊了不到5分钟,让我回去等消息,他会让用人部门进一步评估.至此,再无下文. 2  广州游众软件…
I-number Time Limit: 5000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描写叙述 The I-number of x is defined to be an integer y, which satisfied the the conditions below: 1.  y>x; 2.  the sum of each digit of y(under base 10) is the multiple of 10; 3.  among a…
Instruction Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 347    Accepted Submission(s): 101 Problem Description Nowadays, Jim Green has produced a kind of computer called JG. In his computer…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5912 Problem Description Mr. Frog recently studied how to add two fractions up, and he came up with an evil idea to trouble you by asking you to calculate the result of the formula below:As a talent, ca…