poj 1118 Lining Up(水题)】的更多相关文章

再思考一下好的方法,水过,数据太弱! 本来不想传的! #include <iostream> using namespace std; #define MAX 702 /*284K 422MS*/ typedef struct _point { int x; int y; }point; point p[MAX]; bool judge(point a,point b,point c) { return (a.y-b.y)*(c.x-b.x)-(c.y-b.y)*(a.x-b.x); } in…
POJ 1488 题目大意:给定一篇文章,将它的左引号转成 ``(1的左边),右引号转成 ''(两个 ' ) 解题思路:水题,设置一个bool变量标记是左引号还是右引号即可 /* POJ 1488 Tex Quotes --- 水题 */ #include <cstdio> #include <cstring> int main() { #ifdef _LOCAL freopen("D:\\input.txt", "r", stdin); #…
http://poj.org/problem?id=3461 直接KMP就好.水题 #include<cstdio> #include<cstring> const int MAXN=10000+10; const int MAXM=1000000+10; char P[MAXN],T[MAXM]; int f[MAXN],n,m,ans; void getFail() { f[0]=f[1]=0; for(int i=1;i<n;i++){ int j = f[i]; wh…
Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Description Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical,…
487-3279 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 236746   Accepted: 41288 Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phras…
Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 99450   Accepted: 48213 Description How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're as…
一.Description Suppose you are reading byte streams from any device, representing IP addresses. Your task is to convert a 32 characters long sequence of '1s' and '0s' (bits) to a dotted decimal format. A dotted decimal format for an IP address is form…
一.Description The king pays his loyal knight in gold coins. On the first day of his service, the knight receives one gold coin. On each of the next two days (the second and third days of service), the knight receives two gold coins. On each of the ne…
http://poj.org/problem?id=1118 直接枚举O(n^3) 1500ms能过...数据太水了...这个代码就不贴了... 斜率排序O(n^2logn)是更好的做法...枚举斜率...直线方程相同的线段数量k...一定满足方程 n(n-1)/2=k  ---------------  还真是baka. 到2点才想出这个结论 特判只有一个点,两个点的情况...500ms AC /********************* Template ******************…
题意:给你两个数,求所有的数位的积的和. 析:太水了,没的说,可以先输入边算,也可以最后再算,一样.. 代码如下: #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include <iostream> #include <cstring> #include <set> #include <queue> #inclu…