afterward

导航

 

2012年8月3日

摘要: View Code #include<iostream>#include<iomanip>#include<cstdio>#include<queue>using namespace std;struct node{ int dest; double value; node* next; node() { next=NULL; }}edge[50010];//构造点int n,s,t;double power;double len[50010];node temp[2500010];queue<int> ans;void bfs(){ 阅读全文
posted @ 2012-08-03 19:02 afterward 阅读(265) 评论(0) 推荐(0) 编辑
 
摘要: 一点都不知道这个公式怎么来的?求解释!!!代码是别人的。答案挺对的。求解公式来的过程,翻译题目就不用。泪!这个题放在高中可能还知道,全忘干净了。View Code #include <cstdio>#include <iostream>using namespace std;const int maxn = 22;double p[maxn];int main() { int n,i,j; while (~scanf("%d",&n)) { for (i = 0; i < n; ++i) scanf("%lf",&a 阅读全文
posted @ 2012-08-03 17:17 afterward 阅读(206) 评论(0) 推荐(0) 编辑
 
摘要: View Code /* pku 3414 Pots BFS+记录路径2011-04-15 18:00题目意思.1. 给出两个容积分别为 A 、B 的空瓶子,求经过下列操作是否能得到某个瓶子 装 体积为 C 的水。2. 1> 把某个瓶子装满,2> 把某个瓶子的水倒光,3> 把某个瓶子的水倒入另一个。思路: 由于 某个状态最多可以推出 六个状态。 1> 当 A 瓶未满时,把 A 瓶装满 2> 当 B 瓶未满时,把 B 瓶装满 3> 当 A 瓶非空时,把 A 瓶倒光 4> 当 B 瓶非空时,把 B 瓶倒光 ... 阅读全文
posted @ 2012-08-03 10:39 afterward 阅读(159) 评论(0) 推荐(0) 编辑