http://ipmitool.sourceforge.net/ Last updated Thu Apr 26 09:08:52 PDT 2007 Revision 1.21 · Home· Download· Documentation· Mailing List· Sourceforge Introduction IPMItool is a utility for managing and configuring devices that support the Intelligent P…
191.   The Worm Turns Time Limit: 1.0 Seconds   Memory Limit: 65536K Total Runs: 5465   Accepted Runs: 1774 Worm is an old computer game. There are many versions, but all involve maneuvering a "worm" around the screen, trying to avoid running th…
The Worm Turns Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 106 Accepted Submission(s): 54   Problem Description Winston the Worm just woke up in a fresh rectangular patch of earth. The rectang…
B - The Worm Turns Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Description Worm is an old computer game. There are many versions, but all involve maneuvering a "worm" around the screen, trying to…
1783: [Usaco2010 Jan]Taking Turns Description Farmer John has invented a new way of feeding his cows. He lays out N (1 <= N <= 700,000) hay bales conveniently numbered 1..N in a long line in the barn. Hay bale i has weight W_i (1 <= W_i <= 2,0…
Winston the Worm just woke up in a fresh rectangular patch of earth. The rectangular patch is divided into cells, and each cell contains either food or a rock. Winston wanders aimlessly for a while until he gets hungry; then he immediately eats the f…
原题链接 题目大意:贪吃蛇的简化版,给出一串操作命令,求蛇的最终状态是死是活. 解法:这条蛇一共20格的长度,所以用一个20个元素的队列表示,队列的每个元素是平面的坐标.每读入一条指令,判断其是否越界,是否咬到了自己.若都没有,把改点压入队列,front元素弹出. 参考代码: #include<iostream> #include<queue> #include<string> using namespace std; struct Point{ int r; int…
DFS. /* 2782 */ #include <iostream> #include <queue> #include <cstdio> #include <cstring> #include <cstdlib> using namespace std; #define MAXN 650 int n, m; bool visit[MAXN][MAXN]; int ansd, ansx, ansy, ansb; ][] = { // E, N,…
题意: 一排数,两个人轮流取数,保证取的位置递增,每个人要使自己取的数的和尽量大,求两个人都在最优策略下取的和各是多少. 注:双方都知道对方也是按照最优策略取的... 傻逼推了半天dp......然后看kpm的代码里一个语句解决 KPM大概思路:倒着取,设当前两人最大和分别为A和B(A为先取的人)..如果B+W[i]>A就把A和B交换(先取的人可以按照更优的取法,后手无人权..)..让A取W[i] 接下来是蒟蒻的傻逼写法: f[0][i],f[1][i]分别表示第1个人和第2个人,在i~n中取了…
不知道该叫贪心还是dp 倒着来,记f[0][i],f[1][i]分别为先手和后手从n走到i的最大值.先手显然是取最大的,当后手取到比先手大的时候就交换 #include<iostream> #include<cstdio> using namespace std; const int N=700005; int n,a[N],w=n; long long f[2][N],mx; int read() { int r=0,f=1; char p=getchar(); while(p&…