POJ 1286 Necklace of Beads

Polya定理。#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;long long tab[50],n,ans=0;lo
9次阅读

POJ 1696 Space Ant

卷包裹。这是一个变形的极角排序。为什么这样排序就是对的呢?因为我们一开始选的左下的点,那么所有的点都在它的上方。如果有点在它的下方,就会出现循环着>0。重点在选点的顺序上。#include<iostream>#include<cstdio>#include<cst
6次阅读

hdu 1542&&poj 1151 Atlantis[线段树+扫描线求矩形面积的并]

Atlantis Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11777 &nbs
10次阅读

POJ 1556 The Doors

线段求交+spfa.#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<queue>#include<cmath>#def
8次阅读

POJ 1269 Intersecting Lines

直线求交,我的方法是叉积为0联立解方程。#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<cmath>#define maxn 10
8次阅读

POJ 3304 Segments

如果存在一条穿过所有线段的直线,那么这条直线的垂线就满足题意了。如果存在一条穿过所有线段的直线,那么存在一条穿过所有线段,且穿过了不同线段的两个端点的这样一条直线。算几真TM烦各种细节各种挂精度。#include<iostream>#include<cstdio>#inclu
11次阅读

POJ 2887 Big String

Big StringTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 7053 Accepted: 1684DescriptionYou are given a string and supp
11次阅读

POJ 1741 Tree

TreeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 20124 Accepted: 6613Description Give a tree with n vertices,each edg
10次阅读

POJ 2318 TOYS/POJ 2398 Toy Storage

计算几何终于开坑了。。。叉积+二分。#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#define maxn 5050using namespace std;s
16次阅读

POJ 1830 开关问题

开关问题Time Limit: 1000MS Memory Limit: 30000KTotal Submissions: 8083 Accepted: 3199Description有N个相同的开关,每个开关都与某些开关有着联系,每当你打开或者关闭某个开关的
9次阅读