BZOJ1393 [Ceoi2008]knights】的更多相关文章

题意...上ceoi官网看吧... 首先打一下sg函数发现必胜态和必败态的分布位置是有规律的 于是我们只要知道最长步数的必胜态和最长步数的必败态哪个更长就可以了 然后再打一下步数的表...发现必败态的最长步数非常好确定,那么必胜态的步数搜一下就可以了! /************************************************************** Problem: 1393 User: rausen Language: C++ Result: Accepted T…
Search GO 说明:输入题号直接进入相应题目,如需搜索含数字的题目,请在关键词前加单引号 Problem ID Title Source AC Submit Y 1000 A+B Problem 10983 18765 Y 1036 [ZJOI2008]树的统计Count 5293 13132 Y 1588 [HNOI2002]营业额统计 5056 13607 1001 [BeiJing2006]狼抓兔子 4526 18386 Y 2002 [Hnoi2010]Bounce 弹飞绵羊 43…
1391: [Ceoi2008]order Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 1509  Solved: 460[Submit][Status][Discuss] Description 有N个工作,M种机器,每种机器你可以租或者买过来. 每个工作包括若干道工序,每道工序需要某种机器来完成,你可以通过购买或租用机器来完成. 现在给出这些参数,求最大利润 Input 第一行给出 N,M(1<=N<=1200,1<=M<=12…
Knights of the Round Table Time Limit: 7000MS   Memory Limit: 65536K Total Submissions: 12439   Accepted: 4126 Description Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, and drinking with the oth…
Knights of the Round Table Time Limit: 7000MS   Memory Limit: 65536K Total Submissions: 10911   Accepted: 3587 Description Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, and drinking with the oth…
题目 Source http://www.lightoj.com/volume_showproblem.php?problem=1171 Description Given an m x n chessboard where some of the cells are broken. Now you are about to place chess knights in the chessboard. You have to find the maximum number of knights…
[Usaco2005 Dec]Knights of Ni 骑士 Description  贝茜遇到了一件很麻烦的事:她无意中闯入了森林里的一座城堡,如果她想回家,就必须穿过这片由骑士们守护着的森林.为了能安全地离开,贝茜不得不按照骑士们的要求,在森林寻找一种特殊的灌木并带一棵给他们.当然,贝茜想早点离开这可怕的森林,于是她必须尽快完成骑士们给的任务,贝茜随身带着这片森林的地图,地图上的森林被放入了直角坐标系,并按x,y轴上的单位长度划分成了W×H(1≤W,H≤1000)块,贝茜在地图上查出了她自…
Knights of the Round Table Description Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, and drinking with the other knights are fun things to do. Therefore, it is not very surprising that in recent…
Knights of the Round Table Time Limit: 7000MS   Memory Limit: 65536K Total Submissions: 9169   Accepted: 2960 Description Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, and drinking with the othe…
G - Game of Hyper Knights Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Description A Hyper Knight is like a chess knight except it has some special moves that a regular knight cannot do. Alice and Bob are p…
[Cerc2015]Kernel Knights Time Limit: 2 Sec Memory Limit: 512 MBSubmit: 5 Solved: 4[Submit][Status][Discuss]Description “Jousting”是一种让骑士在高速骑行中用木制长矛相互攻击对方的中世纪竞技游戏.现在,一共有2n个骑士进入一场“Jousting”锦标赛.骑士们被平均分配到2个house.竞赛开始时,所有骑士都会对另一个house的骑士之一发起挑战.一组解被定义为一个集合S…
网络流/最小割 暴力建图就好了……S->i 容量为收益,i->j+n 容量为租金,j+n->T容量为购买所花的钱. 如果亏钱的话那么割掉的就是收益,表示不赚钱. 如果租金大于购买所花的钱就会割掉购买的钱(因为流量限制住了……) 表示T到死啊……copy了Hzwer……orz #include<iostream> #include<cstring> #include<cstdio> #define inf 0x7fffffff using namespa…
Kernel Knights 题目链接: http://acm.hust.edu.cn/vjudge/contest/127407#problem/K Description Jousting is a medieval contest that involves people on horseback trying to strike each other with wooden lances while riding at high speed. A total of 2n knights…
Problem D: Queens, Knights and PawnsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=88443#problem/D Description You all are familiar with the famous 8-queens problem which asks you to place 8 queens…
Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, anddrinking with the other knights are fun things to do. Therefore, it is not very surprising that in recentyears the kingdom of King Arthur has exp…
1391: [Ceoi2008]order Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 1105  Solved: 331[Submit][Status][Discuss] Description 有N个工作,M种机器,每种机器你可以租或者买过来. 每个工作包括若干道工序,每道工序需要某种机器来完成,你可以通过购买或租用机器来完成. 现在给出这些参数,求最大利润 Input 第一行给出 N,M(1<=N<=1200,1<=M<=12…
1671: [Usaco2005 Dec]Knights of Ni Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 175  Solved: 107[Submit][Status][Discuss] Description Bessie is in Camelot and has encountered a sticky situation: she needs to pass through the forest that is guarded b…
Description Bessie is in Camelot and has encountered a sticky situation: she needs to pass through the forest that is guarded by the Knights of Ni. In order to pass through safely, the Knights have demanded that she bring them a single shrubbery. Tim…
Description Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, and drinking with the other knights are fun things to do. Therefore, it is not very surprising that in recent years the kingdom of King…
1671: [Usaco2005 Dec]Knights of Ni 骑士 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 254  Solved: 163[Submit][Status][Discuss] Description Bessie is in Camelot and has encountered a sticky situation: she needs to pass through the forest that is guarde…
BZOJ_1391_[Ceoi2008]order_最大权闭合子图 Description 有N个工作,M种机器,每种机器你可以租或者买过来. 每个工作包括若干道工序,每道工序需要某种机器来完成,你可以通过购买或租用机器来完成. 现在给出这些参数,求最大利润 Input 第一行给出 N,M(1<=N<=1200,1<=M<=1200) 下面将有N块数据,每块数据第一行给出完成这个任务能赚到的钱(其在[1,5000])及有多少道工序 接下来若干行每行两个数,分别描述完成工序所需要的机…
Problem  UVALive - 3523 - Knights of the Round Table Time Limit: 4500 mSec Problem Description Input The input contains several blocks of test cases. Each case begins with a line containing two integers 1 ≤ n ≤ 1000 and 1 ≤ m ≤ 1000000. The number n…
P4177 [CEOI2008]order 如果不能租机器,这就是最大权闭合子图的题: 给定每个点的$val$,并给出限制条件:如果取点$x$,那么必须取$y_1,y_2,y_3......$,满足$val_x>0,val_{y_i}<0$ 求最大点权和. 对于一个图,跑过最小割(最大流)后 有若干个点与源点$S$仍连通,我们把这部分点集称为$S$割 与汇点$T$仍连通的点的点集,称为$T$割 我们把$S$割内的点视作被取走,$T$割内的点视为不被取. 考虑建个新图来表示点之间的关系 在图中,…
[程序结果:用例未完全通过,本博文仅为暂存代码之目的] /* B. Knights of a Polygonal Table url:http://codeforces.com/problemset/problem/994/B 思路: step0.对骑士进行编号 step1.按照权力值进行顺序排序 step2.分别计算骑士所能杀死的其他骑士及其对应的金币值 step3.按照编号重新恢复原始排序. */ //#include<bits/stdc++.h> #include<iostream…
Being a knight is a very attractive career: searching for the Holy Grail, saving damsels in distress, and drinking with the other knights are fun things to do. Therefore, it is not very surprising that in recent years the kingdom of King Arthur has e…
1391: [Ceoi2008]order Description 有N个工作,M种机器,每种机器你可以租或者买过来. 每个工作包括若干道工序,每道工序需要某种机器来完成,你可以通过购买或租用机器来完成. 现在给出这些参数,求最大利润 Input 第一行给出 N,M(1<=N<=1200,1<=M<=1200) 下面将有N块数据,每块数据第一行给出完成这个任务能赚到的钱(其在[1,5000])及有多少道工序 接下来若干行每行两个数,分别描述完成工序所需要的机器编号及租用它的费用(其…
[CEOI2008]order 题目描述: 有N个任务,M种机器,每种机器你可以租或者买过来. 每个工作包括若干道工序,每道工序需要某种机器来完成,你可以通过购买或租用机器来完成. 现在给出这些参数,求最大利润 输入格式: 第一行给出 N, M (1 <= N <= 1200, 1 <= M <= 1200) 下面将有N个任务的数据. 每组数据第一行给出完成这个任务能赚到的钱([1,5000])及有多少道工序 接下来若干行每行两个数,分别描述完成工序所需要的机器编号及租用它的费用(…
题目链接:uva 696 - How Many Knights 题目大意:给出一个n * m的网格,计算最多可以放置几个国际象棋中的骑士. 解题思路:分成三类来讨论: 1)min(n, m) == 1, 也就是无论怎么摆也不会影响到其他的骑士. 2)min(n, m) == 2, 这是将网格将网格分成2*4的若干部分,每个部分的前半部分放置骑士,主要注意模4后剩余部分的处理. 3)n *m的网格上间隔摆放(就是对应的黑格子或者白格子)(n * m - 1)/ 2 #include <stdio.…
King Arthur's Knights Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1415 Accepted Submission(s): 612 Special Judge Problem Description I am the bone of my sword. Steel is my body, and the fire i…
http://www.lydsy.com/JudgeOnline/problem.php?id=1671 从骑士bfs一次,然后从人bfs一次即可. #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <algorithm> #include <queue> using na…