上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页
摘要: 任何一个大学生对菲波那契数列(Fibonacci numbers)应该都不会陌生,它是这样定义的: F(1)=1; F(2)=2; F(n)=F(n-1)+F(n-2)(n>=3); 所以,1,2,3,5,8,13……就是菲波那契数列。 在HDOJ上有不少相关的题目,比如1005 Fibonacci 阅读全文
posted @ 2019-01-28 19:42 StarHai 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Stan and Ollie play the game of multiplication by multiplying an integer p by one of the numbers 2 to 9. Stan always starts with p = 1, does his multi 阅读全文
posted @ 2019-01-28 19:39 StarHai 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Little John is playing very funny game with his younger brother. There is one big box filled with M&Ms of different colors. At first John has to eat s 阅读全文
posted @ 2019-01-28 19:37 StarHai 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Arthur and his sister Caroll have been playing a game called Nim for some time now. Nim is played as follows: The starting position has a number of he 阅读全文
posted @ 2019-01-28 19:35 StarHai 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Two people face two piles of stones and make a game. They take turns to take stones. As game rules, there are two different methods of taking stones: 阅读全文
posted @ 2019-01-28 19:32 StarHai 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Let's consider m apples divided into n groups. Each group contains no more than 100 apples, arranged in a line. You can take any number of consecutive 阅读全文
posted @ 2019-01-28 19:28 StarHai 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 大学英语四级考试就要来临了,你是不是在紧张的复习?也许紧张得连短学期的ACM都没工夫练习了,反正我知道的Kiki和Cici都是如此。当然,作为在考场浸润了十几载的当代大学生,Kiki和Cici更懂得考前的放松,所谓“张弛有道”就是这个意思。这不,Kiki和Cici在每天晚上休息之前都要玩一会儿扑克牌 阅读全文
posted @ 2019-01-28 19:26 StarHai 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 十年前读大学的时候,中国每年都要从国外引进一些电影大片,其中有一部电影就叫《勇敢者的游戏》(英文名称:Zathura),一直到现在,我依然对于电影中的部分电脑特技印象深刻。 今天,大家选择上机考试,就是一种勇敢(brave)的选择;这个短学期,我们讲的是博弈(game)专题;所以,大家现在玩的也是“ 阅读全文
posted @ 2019-01-28 19:24 StarHai 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 题解:最大流板题;增加两个源点,一个汇点。第一个源点到第二个源点连边,权为K,然后第一个源点再连其他点(英雄点)边权各为1,然后英雄和怪物之间按照所给连边(边权为1)。 每个怪物连终点,边权为1; 参考代码: 1 #include<bits/stdc++.h> 2 using namespace s 阅读全文
posted @ 2019-01-28 19:17 StarHai 阅读(505) 评论(0) 推荐(0) 编辑
摘要: 新的技术正冲击着手机通讯市场,对于各大运营商来说,这既是机遇,更是挑战。THU集团旗下的CS&T通讯公司在新一代通讯技术血战的前夜,需要做太多的准备工作,仅就站址选择一项,就需要完成前期市场研究、站址勘测、最优化等项目。在前期市场调查和站址勘测之后,公司得到了一共N个可以作为通讯信号中转站的地址,而 阅读全文
posted @ 2019-01-28 19:07 StarHai 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 小w来到百度之星的赛场上,准备开始实现一个程序自动分析系统。 这个程序接受一些形如 xi=xj 或 xi≠xj 的相等/不等约束条件作为输入,判定是否可以通过给每个 w 赋适当的值,来满足这些条件。 输入包含多组数据。 然而粗心的小w不幸地把每组数据之间的分隔符删掉了。 他只知道每组数据都是不可满足 阅读全文
posted @ 2019-01-28 19:00 StarHai 阅读(349) 评论(0) 推荐(0) 编辑
摘要: java中大数以及高精度常用函数 使用java大数类解决问题时我们需要注意两个方面:1、不能有包名,也就是说我们要把主类放到默认的包里,如果你的代码里出现形如package cn.gov.test;这样的代码你很有可能会收获到RE 2、提交的类的类名必须为Main,如果是其他的名字你有可能收获到CE 阅读全文
posted @ 2019-01-27 14:57 StarHai 阅读(569) 评论(0) 推荐(0) 编辑
摘要: You are given a tree with N nodes which are numbered by integers 1..N. Each node is associated with an integer as the weight. Your task is to deal wit 阅读全文
posted @ 2019-01-24 14:26 StarHai 阅读(370) 评论(0) 推荐(0) 编辑
摘要: 辉辉热衷于洞穴勘测。某天,他按照地图来到了一片被标记为JSZX的洞穴群地区。经过初步勘测,辉辉发现这片区域由n个洞穴(分别编号为1到n)以及若干通道组成,并且每条通道连接了恰好两个洞穴。假如两个洞穴可以通过一条或者多条通道按一定顺序连接起来,那么这两个洞穴就是连通的,按顺序连接在一起的这些通道则被称 阅读全文
posted @ 2019-01-24 14:21 StarHai 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 小T有一个很大的书柜。这个书柜的构造有些独特,即书柜里的书是从上至下堆放成一列。她用1到n的正整数给每本书都编了号。 小T在看书的时候,每次取出一本书,看完后放回书柜然后再拿下一本。由于这些书太有吸引力了,所以她看完后常常会忘记原来是放在书柜的什么位置。不过小T的记忆力是非常好的,所以每次放书的时候 阅读全文
posted @ 2019-01-24 14:18 StarHai 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 火星人最近研究了一种操作:求一个字串两个后缀的公共前缀。比方说,有这样一个字符串:madamimadam,我们将这个字符串的各个字符予以标号:序号: 1 2 3 4 5 6 7 8 9 10 11 字符 m a d a m i m a d a m 现在,火星人定义了一个函数LCQ(x, y),表示: 阅读全文
posted @ 2019-01-24 14:14 StarHai 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 最近,阿Q开了一间宠物收养所。收养所提供两种服务:收养被主人遗弃的宠物和让新的主人领养这些宠物。每个领养者都希望领养到自己满意的宠物,阿Q根据领养者的要求通过他自己发明的一个特殊的公式,得出该领养者希望领养的宠物的特点值a(a是一个正整数,a<2^31),而他也给每个处在收养所的宠物一个特点值。这样 阅读全文
posted @ 2019-01-24 13:58 StarHai 阅读(250) 评论(0) 推荐(0) 编辑
摘要: Bobo has a tree with n vertices numbered by 1,2,…,n and (n-1) edges. The i-th vertex has color c i, and the i-th edge connects vertices a i and b i. L 阅读全文
posted @ 2019-01-19 21:34 StarHai 阅读(291) 评论(0) 推荐(0) 编辑
摘要: You are given a rooted undirected tree consisting of nn vertices. Vertex 11 is the root. Let's denote a depth array of vertex xx as an infinite sequen 阅读全文
posted @ 2019-01-19 21:28 StarHai 阅读(418) 评论(0) 推荐(0) 编辑
摘要: You are given a rooted tree with root in vertex 1. Each vertex is coloured in some colour. Let's call colour c dominating in the subtree of vertex v i 阅读全文
posted @ 2019-01-19 21:18 StarHai 阅读(416) 评论(1) 推荐(0) 编辑
摘要: Once in a forest, there lived N aggressive monkeys. At the beginning, they each does things in its own way and none of them knows each other. But monk 阅读全文
posted @ 2019-01-19 21:09 StarHai 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 在一个忍者的帮派里,一些忍者们被选中派遣给顾客,然后依据自己的工作获取报偿。在这个帮派里,有一名忍者被称之为 Master。除了 Master以外,每名忍者都有且仅有一个上级。为保密,同时增强忍者们的领导力,所有与他们工作相关的指令总是由上级发送给他的直接下属,而不允许通过其他的方式发送。现在你要招 阅读全文
posted @ 2019-01-19 21:05 StarHai 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 订票咨询管理系统 设计编制一个订票管理系统,考虑旅客不同的要求。例如,选择不同的交通工具,希望在旅途中的时间尽可能地短,期望旅费尽可能省,或要求中转次数最少等。为旅客提供两种或三种最优决策。车票基本信息包括:车次、出发站、终点站、额定票数、已订票人数、金额、座位号、发车时间、到站时间等。 基本功能与 阅读全文
posted @ 2019-01-17 11:02 StarHai 阅读(1125) 评论(0) 推荐(0) 编辑
摘要: Max Mex 题目地址:https://codeforces.com/contest/1084/problem/F Max Mex 然后合并时注意分情况讨论: 参考代码: 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define pb p 阅读全文
posted @ 2018-12-29 16:44 StarHai 阅读(431) 评论(0) 推荐(0) 编辑
摘要: A. The Fair Nut and Elevator time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A. The Fair 阅读全文
posted @ 2018-12-25 22:29 StarHai 阅读(481) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页