随笔分类 -  编程竞赛

OJ上的编程题和提交通过的代码
摘要:描述 人生来就有三个生理周期,分别为体力、感情和智力周期,它们的周期长度为23天、28天和33天。每一个周期中有一天是高峰。在高峰这天,人会在相应的方面表现出色。例如,智力周期的高峰,人会思维敏捷,精力容易高度集中。因为三个周期的周长不同,所以通常三个周期的高峰不会落在同一天。对于每个人,我们想知道 阅读全文
posted @ 2018-02-07 22:20 Reqaw 阅读(949) 评论(4) 推荐(0)
摘要:描述赛利有12枚银币。其中有11枚真币和1枚假币。假币看起来和真币没有区别,但是重量不同。但赛利不知道假币比真币轻还是重。于是他向朋友借了一架天平。朋友希望赛利称三次就能找出假币并且确定假币是轻是重。例如:如果赛利用天平称两枚硬币,发现天平平衡,说明两枚都是真的。如果赛利用一枚真币与另一枚银币比较, 阅读全文
posted @ 2018-02-07 22:19 Reqaw 阅读(1460) 评论(0) 推荐(0)
摘要:描述 形如a3= b3 + c3 + d3的等式被称为完美立方等式。例如123= 63 + 83 + 103 。编写一个程序,对任给的正整数N (N≤100),寻找所有的四元组(a, b, c, d),使得a3 = b3 + c3 + d3,其中a,b,c,d 大于 1, 小于等于N,且b<=c<= 阅读全文
posted @ 2018-02-07 22:16 Reqaw 阅读(497) 评论(0) 推荐(0)
摘要:题目链接: http://bailian.openjudge.cn/practice/2811/ 描述 有一个由按钮组成的矩阵,其中每行有6个按钮,共5行。每个按钮的位置上有一盏灯。当按下一个按钮后,该按钮以及周围位置(上边、下边、左边、右边)的灯都会改变一次。即,如果灯原来是点亮的,就会被熄灭;如 阅读全文
posted @ 2018-02-07 22:10 Reqaw 阅读(548) 评论(0) 推荐(0)
摘要:题目描述: Professor Clumsey is going to give an important talk this afternoon. Unfortunately, he is not a very tidy person and has put all his transparenc 阅读全文
posted @ 2018-02-07 22:04 Reqaw 阅读(244) 评论(0) 推荐(0)
摘要:题目描述: For each list of words, output a line with each word reversed without changing the order of the words. This problem contains multiple test cases 阅读全文
posted @ 2018-02-07 22:00 Reqaw 阅读(941) 评论(0) 推荐(0)
摘要:题目链接: https://vjudge.net/problem/POJ-3009 题目描述: On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are so 阅读全文
posted @ 2018-02-01 12:09 Reqaw 阅读(219) 评论(0) 推荐(0)
摘要:题目链接: https://vjudge.net/problem/POJ-1976 题目描述: A train has a locomotive that pulls the train with its many passenger coaches. If the locomotive break 阅读全文
posted @ 2018-02-01 11:46 Reqaw 阅读(304) 评论(0) 推荐(0)
摘要:题目链接: https://vjudge.net/problem/POJ-3624 题目描述: Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill 阅读全文
posted @ 2018-02-01 11:34 Reqaw 阅读(223) 评论(0) 推荐(0)
摘要:题目来源: https://vjudge.net/problem/POJ-2524 题目描述: There are so many different religions in the world today that it is difficult to keep track of them al 阅读全文
posted @ 2018-02-01 10:11 Reqaw 阅读(264) 评论(0) 推荐(0)
摘要:题意描述: 给出一段只包含()和[]的字符串,判断是否合法,合法输出YES,不合法输出NO 规则: 1、该串为空,则合法 2、若A合法,B合法,则AB合法 3、若A合法,则(A)和[A]均合法 解题思路: 括号匹配问题,使用栈来解决,需要注意的是用gets来读取,当该串为空时,输出YES 代码实现: 阅读全文
posted @ 2018-01-24 22:57 Reqaw 阅读(213) 评论(0) 推荐(0)
摘要:题目来源: http://acm.hdu.edu.cn/showproblem.php?pid=1242 题目描述: Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The p 阅读全文
posted @ 2018-01-24 22:46 Reqaw 阅读(245) 评论(0) 推荐(0)
摘要:题目来源: http://poj.org/problem?id=2255 题目描述: Description Little Valentine liked playing with binary trees very much. Her favorite game was constructing 阅读全文
posted @ 2018-01-24 22:23 Reqaw 阅读(303) 评论(0) 推荐(0)
摘要:题目链接: http://poj.org/problem?id=2359 题意描述: 输入一个字符串 按照下面的规则,如果剩下的最后一个字符是‘?’,输出“Yes”,如果剩下的最后一个字符是' '(空格),输出“No”,其他字符均输出“No comments” 规则: 将该字符串首尾相接,从第一个字 阅读全文
posted @ 2017-10-10 20:17 Reqaw 阅读(448) 评论(0) 推荐(0)
摘要:题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=1069 题意描述: 给n块砖,给出其长,宽和高 问将这n块砖,怎样叠放使得满足以下条件使得高度最高,是多少 条件:A砖要放在B砖上,必须满足,A的长和宽都同时小于B的长和宽。 解题思路: 首 阅读全文
posted @ 2017-10-09 19:52 Reqaw 阅读(222) 评论(0) 推荐(0)
摘要:题目链接 :http://poj.org/problem?id=2472 Description In the movie "Blues Brothers", the orphanage where Elwood and Jack were raised may be sold to the Boa 阅读全文
posted @ 2017-10-09 19:29 Reqaw 阅读(419) 评论(0) 推荐(0)
摘要:题目链接: http://poj.org/problem?id=3923 题意描述: 输入一个n*m的屏幕 该屏幕内有至少一个对话框(每个对话框都有对应的字母表示) 判断并输出该屏幕内处于最表层的对话框是哪些(有多个的话按字典序) 解题思路: 很接近生活的一道模拟题,考察了思维的缜密性,尤其是出现嵌 阅读全文
posted @ 2017-10-02 22:25 Reqaw 阅读(345) 评论(0) 推荐(0)
摘要:题目链接: http://poj.org/problem?id=3829 题意描述: 输入矩阵的大小n和m,以及来占位置的人数k 输入n*m的教室座位矩阵,每个值表示该座位的满意度 输入每个人来占位置的时间和需要几个位置h,m,q 计算并输出每个来占位置的人根据占位规则得到的坐标zx,zy,若一个位 阅读全文
posted @ 2017-10-02 22:07 Reqaw 阅读(179) 评论(0) 推荐(0)
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5122 Problem Description Matt’s friend K.Bro is an ACMer.Yesterday, K.Bro learnt an algorithm: Bubble 阅读全文
posted @ 2017-09-15 23:21 Reqaw 阅读(542) 评论(0) 推荐(0)
摘要:题目链接: 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 阅读全文
posted @ 2017-09-15 18:23 Reqaw 阅读(225) 评论(0) 推荐(0)