poj 3311Hie with the Pie】的更多相关文章

题意:一个送披萨的,每次送外卖不超过10个地方,给你这些地方之间的时间,求送完外卖回到店里的总时间最小. 解法一: 这个n不大,即使是NP问题也才1E6多一些所以可以dfs():具体的回溯方法结合dance link 就可以: #include <cstdio> #include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> using namespace s…
题目链接 Description The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries. He will wait for 1 or more (up to 10) orders t…
[SInGuLaRiTy-1025] Copyrights (c) SinGuLaRiTy 2017. All Rights Reserved. [POJ 1905] 棍的膨胀 (Expanding Rods) 题目描述 已知一根长为L的细棍被加热了n摄氏度,那么其新的长度为L'=(1+n*C)*L.中间的C是热膨胀系数.当一根细棍被夹在两面墙中间然后被加热,它会膨胀,其形状会变成一个弧,而原来的细棍(加热前的细棍)就是这个弧所对的弦.你的任务是计算出弧的中点与弦的中点的距离. 输入 包含多组数…
floyd,旅游问题每个点都要到,可重复,最后回来,dp http://poj.org/problem?id=3311 Hie with the Pie Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 4013   Accepted: 2132 Description The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fas…
http://poj.org/problem?id=3122 题意 主人过生日,m个人来庆生,有n块派,m+1个人(还有主人自己)分,问每个人分到的最大体积的派是多大,PS每 个人所分的派必须是在同一个派上切下来的. 分析 二分答案,每次统计当前体积下能分配的人数. #include<iostream> #include<cmath> #include<cstring> #include<queue> #include<vector> #incl…
Hie with the Pie POJ - 3311 The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries. He will wait for 1 or more (up to 1…
id=3122">[POJ 3122] Pie 分f个派给n+1(n个朋友和自己)个人 要求每一个人分相同面积 但不能分到超过一个派 即最多把一整个派给某个人 问能平均分的最大面积 二分平均面积 下界0 上界最大的一份派的面积 推断条件从大派開始分(保证尽量满足)假设能分出n+1份 这样的分法就合适 下界上移 最后输出下界就可以 注意二分推断上下界用esp 否则超时 从大到小分派是一种贪心策略 太小的派能够扔掉 但从小開始分有可能第一个派就分不出这么大 不排序也可遇到小派跳过 最后推断 代…
题目链接:http://poj.org/problem?id=3311 题目大意:一个送披萨的,每次送外卖不超过10个地方,给你这些地方之间的时间,求送完外卖回到店里的总时间最小. Sample Input 3 0 1 10 10 1 0 1 2 10 1 0 10 10 2 10 0 0 Sample Output 8 分析:dp[i][j]:表示在i状态(用二进制表示城市有没有经过)时最后到达j城市的最小时间,转移方程:dp[i][j]=min(dp[i][k]+d[k][j],dp[i][…
题目:http://poj.org/problem?id=3122 这个题就好多了,没有恶心的精度问题,所以1A了.. #include <stdio.h> #include <math.h> ); ], t, n, m; int main() { scanf("%d", &t); while(t--) { , high = ; scanf("%d %d", &n, &m); ; i < n; i++) { sc…
http://poj.org/problem?id=3122 #include<cstdio> #include<cstring> #include<cmath> #define maxn 10010 #include<algorithm> using namespace std; const double pi=acos(-1.0); ; double r[maxn]; int n,f; int main() { int t; scanf("%d…