随笔分类 - 基础算法---搜索
摘要:Description 在一个忍者的帮派里,一些忍者们被选中派遣给顾客,然后依据自己的工作获取报偿。在这个帮派里,有一名忍者被称之为 Master。除了 Master以外,每名忍者都有且仅有一个上级。为保密,同时增强忍者们的领导力,所有与他们工作相关的指令总是由上级发送给他的直接下属,而不允许通过其
阅读全文
摘要:【题目描述】 给定二维平面上n个整点,求该图的一个直线斯坦纳树,使得树的边长度总和尽量小。 直线斯坦纳树:使所有给定的点连通的树,所有边必须平行于坐标轴,允许在给定点外增加额外的中间节点。 如下图所示为两种直线斯坦纳树的生成方案,蓝色点为给定的点,红色点为中间节点。 【输入格式】 第一行一个整数n,
阅读全文
摘要:题目背景 人工神经网络(Artificial Neural Network)是一种新兴的具有自我学习能力的计算系统,在模式识别、函数逼近及贷款风险评估等诸多领域有广泛的应用。对神经网络的研究一直是当今的热门方向,兰兰同学在自学了一本神经网络的入门书籍后,提出了一个简化模型,他希望你能帮助他用程序检验
阅读全文
摘要:题目描述 牛牛最近迷上了一种叫斗地主的扑克游戏。斗地主是一种使用黑桃、红心、梅花、方片的A到K加上大小王的共54张牌来进行的扑克牌游戏。在斗地主中,牌的大小关系根据牌的数码表示如下:3<4<5<6<7<8<9<10<J<Q<K<A<2<小王<大王,而花色并不对牌的大小产生影响。每一局游戏中,一副手牌
阅读全文
摘要:序列(sequence) 【题目描述】 给定一个1~n的排列x,每次你可以将x1~xi翻转。你需要求出将序列变为升序的最小操作次数。有多组数据。 【输入数据】 第一行一个整数t表示数据组数。 每组数据第一行一个整数n,第二行n个整数x1~xn。 【输出数据】 每组数据输出一行一个整数表示答案。 【样
阅读全文
摘要:Description 农夫约翰打算建立一个栅栏将他的牧场给围起来,因此他需要一些特定规格的木材。于是农夫约翰到木材店购 买木材。可是木材店老板说他这里只剩下少部分大规格的木板了。不过约翰可以购买这些木板,然后切割成他所需 要的规格。而且约翰有一把神奇的锯子,用它来锯木板,不会产生任何损失,也就是说
阅读全文
摘要:题目描述 单词接龙是一个与我们经常玩的成语接龙相类似的游戏,现在我们已知一组单词,且给定一个开头的字母,要求出以这个字母开头的最长的“龙”(每个单词都最多在“龙”中出现两次),在两个单词相连时,其重合部分合为一部分,例如 beast和astonish,如果接成一条龙则变为beastonish,另外相
阅读全文
摘要:The input consists of more than one description of town (but totally, less than ten descriptions). Every description starts with number N of towns and
阅读全文
摘要:The Sultan's Successors Description The Sultan of Nubia has no children, so she has decided that the country will be split into up to k separate parts
阅读全文
摘要:Description It is 2084 and the year of Big Brother has finally arrived, albeit a century late. In order to exercise greater control over its citizens
阅读全文
摘要:Computer networking requires that the computers in the network be linked. This problem considers a \linear" network in which the computers are chained
阅读全文
摘要:Cellular automata are mathematical idealizations of physical systems in which both space and time are discrete, and the physical quantities take on a
阅读全文
摘要:Your task is to write a program that can decide whether you can nd an arithmetic expression consisting of ve given numbers ai (1 i 5) that will yi
阅读全文
摘要:ksq2013 UVA 11205 Accepted C++11 5.3.0 2016-08-04 14:25:22 题目大意如下:给定n个LED灯串,每个灯串由p个LED灯构成,并给出每个灯串当下的状态,需要让所有灯串中规定的某些灯灭掉,询问最少剩下几盏正常的灯可以让我们分辨出LED灯原先代表的数
阅读全文
摘要:The Psychic Poker Player Time Limit: 3000MS 64bit IO Format: %lld & %llu Description In 5-card draw poker, a player is dealt a hand of five cards (whi
阅读全文
摘要:问题名称【子集生成算法】 问题目标【给定n个元素(A=[1,n]))构成的集合A,求A的子集(不生成空集)】 算法名称1【增量法】
阅读全文
摘要:Lucy and Lily are twins. Today is their birthday. Mother buys a birthday cake for them. Now we put the cake onto a Descartes coordinate. Its center is
阅读全文
摘要:Channel Allocation Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 14361 Accepted: 7311 Description When a radio station is broadcasting ov
阅读全文
摘要:Sudoku Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17953 Accepted: 8688 Special Judge Description Sudoku is a very simple task. A squar
阅读全文
摘要:Shredding Company Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5379 Accepted: 3023 Description You have just been put in charge of devel
阅读全文

浙公网安备 33010602011771号