
水~
文章平均质量分 56
devYzhou
Be a man,do the right thing
展开
-
poj-1013 Counterfeit Dollar
http://poj.org/problem?id=1013题目要求找出轻的或重的硬币#include #include #include #include using namespace std;#define MAX 1000000int ans[13];char rright[12],lleft[12],re[5];void findx(char str1[],cha原创 2013-08-19 14:40:08 · 758 阅读 · 0 评论 -
poj-1012 Joseph
http://poj.org/problem?id=1012记得这事刚学数据结构链表的经典题目水过题数吧~#include#include using namespace std;int J[14];int k;void init(){ for(int k=1; k<14; k++) { int n=2*k; int ans[原创 2013-08-19 00:17:39 · 731 阅读 · 0 评论 -
poj-3045 Cow Acrobats
题目链接:http://poj.org/problem?id=3045按weight+strength 排序就行了#include #include #include using namespace std;typedef struct{ int weight; int stregth;} COW;COW cow[50010];int n;int cm原创 2013-08-17 11:21:24 · 1371 阅读 · 0 评论 -
poj-3051 Satellite Photographs
题目来源:http://poj.org/problem?id=3051直接广度搜索 水~ 练手#include #include #include using namespace std;typedef struct{ int i; int j;}point;point P[80010];int W,H;char a[1010][90];int bf原创 2013-08-17 11:59:04 · 915 阅读 · 0 评论 -
poj-1200 Crazy Search
题目来源:http://poj.org/problem?id=1200遍历一遍 主要是判重 用到hash 不是很难 水~#include #include #include #include #define NUM 257#define N 16000005using namespace std;bool hash[N];int m[NUM];char s原创 2013-08-16 23:52:51 · 1146 阅读 · 0 评论 -
poj-2100 Graveyard Design
题目来源:http://poj.org/problem?id=2100睡前一水 直接暴力 一顿乱搞#include #include #include using namespace std;long long a[1000][2];int main(){ long long n; while(~scanf("%lld",&n)) {原创 2013-08-16 01:24:43 · 969 阅读 · 0 评论 -
poj-2601Simple calculations
题目来源:http://poj.org/problem?id=2601给你公式ai = (ai-1 + ai+1)/2 - ci给你a0 、 an+1 和 c1~ cn 要求 a1易推2an=a(n-1) +a(n+1) -2cn;所以 2a1=a0+a2-2c1; 2a2=a1+a3-2c2; :原创 2013-08-16 16:01:09 · 840 阅读 · 0 评论 -
poj-2479 简单DP
题目来源:http://poj.org/problem?id=2479题目大意就是求一个数组里面的两端连续值得最大和DP从前往后扫一遍 再从后往前扫一遍然后求1~i 和i+1~n的和的最大值注意题目要求必须得最低取两个数#include #include #define MAXN 50010#define MIN -10000using namespace std;i原创 2013-08-15 23:41:02 · 757 阅读 · 0 评论 -
poj-1740 A New Stone Game 博弈论
题目来源:http://poj.org/problem?id=1740刚刚看完博弈论的几篇文章,找了这水题,根据论文里面的思路很清楚了#include //只需要判断它是不是有N对相等的情况#include #include #include using namespace std;bool f[1005];int main(){ int n; whi原创 2013-08-14 21:11:03 · 846 阅读 · 0 评论 -
poj-3903 Stock Exchang O(N*logN)
题目来源:http://poj.org/problem?id=3903睡前水题一道 O(N*logN) 最长上升子序列#include #include #include #define MAXN 100010using namespace std;long long a[MAXN],b[MAXN];int sum=1,n;void find(int x){ in原创 2013-08-14 01:49:54 · 728 阅读 · 0 评论 -
poj-2484 A Funny Game
http://poj.org/problem?id=2484睡前也没想这么水的~ 但是运气就这样 哈哈博弈论真是说不清楚呀~#include #include using namespace std;int main(){ int n; while(~scanf("%d",&n)) { if(!n) bre原创 2013-08-15 01:36:21 · 734 阅读 · 0 评论 -
poj-1256 Anagram 全排列
题目来源:http://poj.org/problem?id=1256题目大意是求字符串的全排列 要求按A那就把给定的字符串先排序然后通过STL的next_permutation函数生成全排列(C++)#include #include #include using namespace std;bool cmp(char a, char b){ int a原创 2013-08-14 17:45:35 · 1293 阅读 · 0 评论 -
hdu-4671 Backup Plan
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4671水题不多说 记录代码#include #include #include using namespace std;int a[101][101];bool vis[101];int main(){ int n,m; while(~scanf("%d%原创 2013-08-14 01:08:17 · 728 阅读 · 0 评论 -
poj-2406 Power Strings睡前一水~
http://poj.org/problem?id=2406睡前一水~ 一看就觉得是KMP的next数组...然后果然是#include #include #include #define max 1000010int n[max];char str1[max];int next(char s[]){ n[0]=-1; int j=0,k=-1;原创 2013-08-15 00:36:49 · 1208 阅读 · 0 评论