ZJNU 2226 - B.T.B.F】的更多相关文章

d为1代表Alice执刀,-1代表Bob执刀记录蛋糕数字为奇数和偶数各自的数量,先看偶数块 如果为偶数的蛋糕为奇数块,则为偶数的蛋糕切完后是Bob持刀,Alice会多吃1,此时要将奇数块蛋糕-1(假设此时有为奇数的蛋糕,如果没有根据题意依然是Alice赢) 如果为奇数的蛋糕为奇数块,两人每次切时对方都会多1,,中和后即对2取余,若取余结果为0说明两人在这一部分吃的一样多,否则Alice会多持刀一次,Bob会多吃1 最后,如果Bob吃得多,Bob赢,反之(包括平局),Alice赢且若有蛋糕数字为1…
查询数据操作…
题目地址:http://poj.org/problem?id=2226 二分图的题目关键在于建图.因为“*”的地方只有两种木板覆盖方式:水平或竖直,所以运用这种方式进行二分.首先按行排列,算出每个"*"的序号xi,再按列排序,算出序号yi. 从X集合向Y集合连边.G[xi][yi]=1; 然后就是求二分图的最小顶点覆盖.因为二分图最小点覆盖=最大匹配数.所以匈牙利算法求一下最大匹配就可以了. #include<cstdio> #include<iostream>…
HDU3047 Zjnu Stadium Problem Description In 12th Zhejiang College Students Games 2007, there was a new stadium built in Zhejiang Normal University. It was a modern stadium which could hold thousands of people. The audience Seats made a circle. The to…
Muddy Fields Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12565   Accepted: 4651 Description Rain has pummeled the cows' field, a rectangular grid of R rows and C columns (1 <= R <= 50, 1 <= C <= 50). While good for the grass,…
这道题算是最简单的区间dp了..非常久之前写的,搞懂原理了就1A. 传送门:problem_id=1181">http://acm.zjnu.edu.cn/CLanguage/showproblem?problem_id=1181 状态方程定义: dp[i][j]=min(dp[i][j],dp[i][k]+dp[k+1][j]+sum[i][j]); 然后利用三层for就好了. for(int len=2;len<=n;len++){ for(int s=1;s<=n-len…
Zjnu Stadium Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3179 Accepted Submission(s): 1224 Problem Description In 12th Zhejiang College Students Games 2007, there was a new stadium built in Zh…
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3003 Accepted Submission(s): 1160 Problem Description In 12th Zhejiang College Students Games 2007, there was a new stadium built in Zhejiang Normal…
在使用 C# 与 F# 混合编程的时候(通常是使用 C# 实现 GUI,F#负责数据处理),经常会遇到要判断一个 option 是 None 还是 Some.虽然 Option module 里有 isSome 这样的函数,但还是不够方便.偶然在墙外看到一个解决方法: [<System.Runtime.CompilerServices.Extension>] module Methods = [<System.Runtime.CompilerServices.Extension>]…
前言 面向对象三大基本特性:封装.继承.多态.上一篇中介绍了类的定义,下面就了解下F#中继承和多态的使用吧.…