上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页
摘要: Swap HDU - 2819 Given an N*N matrix with each entry equal to 0 or 1. You can swap any two rows or any two columns. Can you find a way to make all the 阅读全文
posted @ 2018-10-15 22:50 *starry* 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 二分图的最小顶点覆盖 定义:假如选了一个点就相当于覆盖了以它为端点的所有边。最小顶点覆盖就是选择最少的点来覆盖所有的边。 方法:最小顶点覆盖等于二分图的最大匹配。 我们用二分图来构造最小顶点覆盖。 对于上面这个二分图,顶点分为左右两个集合,X集合包含1,2,3,4,Y集合包含5,6,7,8,9.假如 阅读全文
posted @ 2018-10-15 18:19 *starry* 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 石子归并 51Nod - 1021 N堆石子摆成一条线。现要将石子有次序地合并成一堆。规定每次只能选相邻的2堆石子合并成新的一堆,并将新的一堆石子数记为该次合并的代价。计算将N堆石子合并成一堆的最小代价。 例如: 1 2 3 4,有不少合并方法 1 2 3 4 => 3 3 4(3) => 6 4( 阅读全文
posted @ 2018-10-08 17:45 *starry* 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Prime Permutation codeforces 123A You are given a string s, consisting of small Latin letters. Let's denote the length of the string as |s|. The chara 阅读全文
posted @ 2018-10-07 22:59 *starry* 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 小字辈 (25 分) 本题给定一个庞大家族的家谱,要请你给出最小一辈的名单。 输入格式: 输入在第一行给出家族人口总数 N(不超过 100 000 的正整数) —— 简单起见,我们把家族成员从 1 到 N 编号。随后第二行给出 N 个编号,其中第 i 个编号对应第 i 位成员的父/母。家谱中辈分最高 阅读全文
posted @ 2018-10-07 18:14 *starry* 阅读(482) 评论(0) 推荐(0) 编辑
摘要: 博弈论小结 一、重头戏之尼姆博弈 概述:有n堆若干个石子,两个人轮流从某一堆取任意多的石子,规定每次至少取一个,多者不限,最后取光者得胜。 分析一下可知,如果n-2堆石子个数为0,剩下的两堆石子个数相同,那么面临这种局势的人必败。就比如说我有三堆石头个数分别为5 5 0,那么不论先手怎么操作,后手只 阅读全文
posted @ 2018-10-06 21:29 *starry* 阅读(1491) 评论(0) 推荐(0) 编辑
摘要: Hometask codeforces 155C Sergey attends lessons of the N-ish language. Each lesson he receives a hometask. This time the task is to translate some sen 阅读全文
posted @ 2018-10-05 11:31 *starry* 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Lucky Sum Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky dig 阅读全文
posted @ 2018-10-04 18:53 *starry* 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 对称博弈 Coin Game (HDU - 3951) After hh has learned how to play Nim game, he begins to try another coin game which seems much easier. The game goes like 阅读全文
posted @ 2018-09-28 16:59 *starry* 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 尼姆博弈 一篇很好的博客:戳我戳我 尼姆博弈的定义:有若干堆石子,每堆石子的数量都是有限的,合法的移动是“选择一堆石子并拿走若干颗(不能不拿)”,如果轮到某个人时所有的石子堆都已经被拿空了,则判负(因为他此刻没有任何合法的移动)。 更严谨的推导是:1.无法进行任何移动的局面先手必败。2.可以移动到必 阅读全文
posted @ 2018-09-27 17:45 *starry* 阅读(261) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 16 下一页