HDU 1234 简单模拟题】的更多相关文章

题目很简单不多说了,我只是觉得这题目的输入方式还是很有特点的 #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> using namespace std; struct People{ ]; int h1 , h2 , m1 , m2 , s1 , s2; }p[]; bool cmp1(const People &p1 , const Peopl…
这题前三段都是一堆吹爆赞助商的屁话,正式题目在图片下边,一个简单模拟题. 题目大意: 有n个男生,m个女生在进行舞会,其中一部分男生祥和比自己矮的女生跳舞,一部分男生想和比自己高的女生跳舞,一部分女生想和比自己高的男生跳舞,一部分女生想和比自己矮的男生跳舞: 所以,我们可以这样配对:想跟比自己矮的女生跳舞的男生——想跟比自己高的男生跳舞的女生:想跟比自己高的女生跳舞的男生——想跟比自己矮的男生跳舞的女生. 分组,排序,扫描配对,完事.(不过比赛中某人把代码里的n,m搞错了,从开头debug到封榜…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4772 题面: Zhuge Liang's Password Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1404    Accepted Submission(s): 926 Problem Description In the anc…
题目大意:给你一个完全二叉树,并且给他们编号,编号规则为左子树为2*k,右子树为2*k+1,每一个节点 上都有一个开关,初始时开关都处于关闭状态,小球碰到节点就会改变该点的开关的状态.然后给你I个小球, 要求输出第I个小球最终到达的叶子节点的编号. 思路分析:简单的模拟题,主要是要对二叉树的结构和编号原则清楚,有D层,则一共有(1<<D)-1个节点,然 后就可以开一个数组用来储存每一节点的状态,初识化为0,表示均处于关闭状态,然后就开始进行模拟,判断是否 越界通k>n?注意最后 要输出k…
e.... 虽然这是一道灰常简单的模拟题.但是米做的时候没有读懂第二个日历的计时方法.然后捏.敲完之后华丽的WA了进一个点.坑点就在一年的最后一天你是该输出本年的.e ...但是我好想并没有..看discuss里好想被坑的人还不少.总天数能直接整除260的时候.年数要减1. 不喜欢做模拟.....5555.... 附代码: #include<stdio.h>#include<string.h>#include<iostream>#include<string>…
http://acm.hdu.edu.cn/showproblem.php?pid=5059 题目大意: 给定一个字符串,如果这个字符串是一个整数,并且这个整数在[a,b]的范围之内(包括a,b),那就输出YES,其它的都是NO. 这个字符串是整数的条件: 1.如果它是正整数,它只包含前导不是0的数(这个数前面没有零). 2.如果它是负整数,只包含一个'-'符号,任然没有前导0. 3.除此之外都不是非法的 解题思路: http://bestcoder.hdu.edu.cn/ 这里有 要注意: 0…
Xiangqi Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4121 Description Xiangqi is one of the most popular two-player board games in China. The game represents a battle between two armies with the goal of captu…
http://acm.hdu.edu.cn/showproblem.php?pid=5099 比较两个安卓手机型号,水题 注意点:A is actually implicit and usually omitted for brevity.输入字符长度可能为5,这时候individual version的值为A #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #…
A Ducci sequence is a sequence of n-tuples of integers. Given an n-tuple of integers (a1, a2, · · · , an), the next n-tuple in the sequence is formed by taking the absolute differences of neighboring integers: (a1, a2, · · · , an) → (|a1 − a2|, |a2 −…
Spring-outing Decision Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 676    Accepted Submission(s): 220 Problem Description Now is spring ! The sunshine is warm , the flowers is coming out . H…