Roping the Field Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 858   Accepted: 250 Description Farmer John is quite the nature artist: he often constructs large works of art on his farm. Today, FJ wants to construct a giant "field web&…
1719: [Usaco2006 Jan] Roping the Field 麦田巨画 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 82  Solved: 26[Submit][Status][Discuss] Description Farmer John is quite the nature artist: he often constructs large works of art on his farm. Today, FJ wants…
Clockwise Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Saya have a long necklace with N beads, and she signs the beads from 1 to N. Then she fixes them to the wall to show N-1 vectors – vector i starts from bead i and end up with bead i…
//一些点一些圆,过圆不能连线,相邻点不能连线,问最多连几条线 //计算几何模板+区间dp //关键是判断圆和线段是否相交 #include <cstdio> #include <cmath> #include <algorithm> #define N 500 #define ll long long #define sqr(x) ((x)*(x)) using namespace std; bool ok[N][N]; ll n,m,r,f[N][N]; struc…
题目概述 在平面直角坐标系的第$1$象限和第$4$象限有$n$个点,其中第$i$个点的坐标为$(x_i,y_i)$,有一个权值$p_i$ 从原点$O(0,0)$出发,不重复的经过一些点,最终走到原点,围成一个多边形.我们定义开心程度为$f$. 设经过节点总共走的路径长度是$s$,最终路径围成的多边形中所有点的权值和为$w$,则$f = \frac{w}{s}$. 试最大化开心程度$f$.保留$3$位小数后输出$f_{min}$. 对于$100\%$的数据满足$n\leq 2\times 10^3…
守护雅典娜 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 740    Accepted Submission(s): 250 Problem Description 许多塔防游戏都是以经典的“守护雅典娜”为原型的.玩家需要建立各种防御工具来阻止怪物接近我们的女神——雅典娜. 这里,我们可以建造的防御工具只有标准圆形状的防御墙,建立在雅…
题面 传送门 题解 我们枚举这个凸多边形\(y\)坐标最小的点\(p_i\),然后对于所有\(y\)坐标大于等于它的点极角排序 我们预处理出\(s_{j,k}\)表示三角形\(p_i,p_j,p_k\)内部的点的\(b\)总和(不包括边界),然后记\(dp_{i,j,k}\)表示这个凸多边形之前两个点是\(p_i,p_j\),还需要\(k\)个点,最小的\(b\)是多少,然后可以直接记忆化搜索 //minamoto #include<bits/stdc++.h> #define R regis…
枚举起点,然后设f[i][j]为上凸壳上一个点是i当前点是j的最大面积,g是下凸壳,然后合并的时候枚举结束点t合并上下凸壳即可 这样的好处是每次转移都是往凸多边形里加一个三角形(s,i,j),所以判断转移合法只要预处理出所有三角形是否合法即可,同时预处理出三角形面积,转移就是f[j][k]=max(f[j][k],f[i][j]+c[s][j][k]); #include<iostream> #include<cstdio> #include<algorithm> #i…
题目链接:http://poj.org/problem?id=3254 题意: 给你一片n*m的耕地,你可以在上面种玉米.但是其中有一些地方是荒芜的,不能种植.并且种植玉米的地方不能相邻.问你在这片地上有多少种种植方案. 题解: 思路:一行一行种 状态表示: dp[state][i] = num of ways at ith row (1)当前种到了第i行 (2)第i行有哪些地方种了玉米,状态为state 如何转移: 约束条件: (1)对于当前行,已经在某些地方种过了玉米,那么在下一行的对应位置…
题目链接 题意:给你一个n*n矩阵,求这个矩阵的最大子矩阵和 #include<iostream> #include<cstdio> #include<string.h> using namespace std; #define inf -0x3f3f3f3f int field[105][105],dp[105]; int main() { int n; while(~scanf("%d",&n)) { int maxn=0; memset…