摘要:
正弦定理+叉积View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;struct Point{ double x, y; Point operator -(const Point &b) { Point ret; ret.x = this->x - b.x; ret.y = this->y - b.y; return ret; }}p1 阅读全文
posted @ 2013-01-11 20:09
undefined2024
阅读(185)
评论(0)
推荐(0)
摘要:
dfsView Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 20int n;int f[maxn];int g[maxn];void input(){ for (int i = 0; i < n; i++) scanf("%d", &f[i]);}void output(){ for (int i = 0; i < 5; i++) p 阅读全文
posted @ 2013-01-11 19:48
undefined2024
阅读(116)
评论(0)
推荐(0)
摘要:
高精度View Code import java.io.*;import java.util.*;import java.math.*;public class Main { public static void main(String[] args) throws FileNotFoundException {// Scanner cin = new Scanner(new FileInputStream("t.txt")); Scanner cin = new Scanner(System.in); while (cin.hasNext... 阅读全文
posted @ 2013-01-11 17:10
undefined2024
阅读(158)
评论(0)
推荐(0)
摘要:
bfs,数据范围是10View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <queue>using namespace std;#define maxn 10int n, et;bool map[maxn][maxn];bool vis[maxn];int dist[maxn];int dist1[maxn];void input(){ memset(map, 0, sizeof(map)); scanf( 阅读全文
posted @ 2013-01-11 16:50
undefined2024
阅读(192)
评论(0)
推荐(0)
摘要:
题意:平面内最多26个点,给出一些点与点之间的矛盾关系,问最少使用多少颜色才能给这些点染色,并保证矛盾点之间不同色。分析:深搜,对于每个点先尝试已经给别的点染过的颜色,如果不行再尝试染新的颜色,注意新的颜色只需要尝试一次即可,因为各种新的颜色对于当前状态来说是等价的。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define maxn 30#define maxm maxn * maxn# 阅读全文
posted @ 2013-01-11 16:21
undefined2024
阅读(1120)
评论(0)
推荐(0)

浙公网安备 33010602011771号