摘要: 题目描述 小明和小红经常玩一个博弈游戏。给定一个n×n的棋盘,一个石头被放在棋盘的左上角。他们轮流移动石头。每一回合,选手只能把石头向上,下,左,右四个方向移动一格,并且要求移动到的格子之前不能被访问过。谁不能移动石头了就算输。 假如小明先移动石头,而且两个选手都以最优策略走步,问最后谁能赢? 输入 阅读全文
posted @ 2018-11-28 18:31 NKDEWSM 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Farmer John's cows have taken an interest in exploring the territory around the farm. Initially, all N (1 <= N <= 1,000,000,000) cows commence traveli 阅读全文
posted @ 2018-11-28 18:17 NKDEWSM 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 题目背景 二分图 感谢@一扶苏一 提供的hack数据 题目描述 给定一个二分图,结点个数分别为n,m,边数为e,求二分图最大匹配数 输入输出格式 输入格式: 第一行,n,m,e 第二至e+1行,每行两个正整数u,v,表示u,v有一条连边 输出格式: 共一行,二分图最大匹配 输入输出样例 输入样例#1 阅读全文
posted @ 2018-11-27 19:17 NKDEWSM 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Ehab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consist 阅读全文
posted @ 2018-11-25 20:29 NKDEWSM 阅读(433) 评论(0) 推荐(0) 编辑
摘要: Mahmoud has an array a consisting of n integers. He asked Ehab to find another array b of the same length such that: b is lexicographically greater th 阅读全文
posted @ 2018-11-25 19:33 NKDEWSM 阅读(218) 评论(0) 推荐(0) 编辑
摘要: When Kefa came to the restaurant and sat at a table, the waiter immediately brought him the menu. There were n dishes. Kefa knows that he needs exactl 阅读全文
posted @ 2018-11-24 23:40 NKDEWSM 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Kefa decided to celebrate his first big salary by going to the restaurant. He lives by an unusual park. The park is a rooted tree consisting of n vert 阅读全文
posted @ 2018-11-24 21:44 NKDEWSM 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Kefa wants to celebrate his first big salary by going to restaurant. However, he needs company. Kefa has n friends, each friend will agree to go to th 阅读全文
posted @ 2018-11-24 20:35 NKDEWSM 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 题目描述 The N cows (2 <= N <= 1,000) conveniently numbered 1..N are grazing among the N pastures also conveniently numbered 1..N. Most conveniently of al 阅读全文
posted @ 2018-11-23 23:30 NKDEWSM 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 题意翻译 约翰一共有N)个牧场.由M条布满尘埃的小径连接.小径可 以双向通行.每天早上约翰从牧场1出发到牧场N去给奶牛检查身体. 通过每条小径都需要消耗一定的时间.约翰打算升级其中K条小径,使之成为高 速公路.在高速公路上的通行几乎是瞬间完成的,所以高速公路的通行时间为0. 请帮助约翰决定对哪些小径 阅读全文
posted @ 2018-11-23 17:08 NKDEWSM 阅读(230) 评论(0) 推荐(0) 编辑