摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;int main(){ int r, m, y; //freopen("t.txt", "r", stdin); scanf("%d%d%d", &r, &m, &y); long double ans = m; 阅读全文
posted @ 2011-05-25 12:50
undefined2024
阅读(189)
评论(0)
推荐(0)
摘要:
高精度,java做View Code import java.util.*;import java.io.*;import java.math.*;public class Main { static public void main(String args[]) throws FileNotFoundException{ Scanner cin = new Scanner(new BufferedInputStream(System.in)); //Scanner cin = new Scanner(new FileInputStream("t.txt")); Strin 阅读全文
posted @ 2011-05-25 12:36
undefined2024
阅读(194)
评论(0)
推荐(0)
摘要:
最短路View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <queue>using namespace std;#define V 1005#define E 5005#define inf 0x3f3f3f3f;int cost[E], dist[V];int e, pnt[E], nxt[E], head[V], prev[V], vis[V];int n, m;struct qnode{ int v, 阅读全文
posted @ 2011-05-25 09:51
undefined2024
阅读(357)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <queue>using namespace std;#define maxn 106struct XPoint{ int x; int y; XPoint(int xx, int yy) : x(xx), y(yy) { } XPoint() { }};int n, m;bool map[maxn][maxn];bool vis[maxn][max 阅读全文
posted @ 2011-05-25 09:23
undefined2024
阅读(473)
评论(0)
推荐(0)
摘要:
最大生成树,注意边数组开二倍大小。注意不连通输出-1;View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <queue>using namespace std;#define maxn 1005#define maxm 20005struct Edge{ int v, next, w; Edge(int vv, int nn, int ww) : v(vv), next(nn), w(ww) { } Edg 阅读全文
posted @ 2011-05-25 09:03
undefined2024
阅读(303)
评论(0)
推荐(0)