水~
文章平均质量分 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 1000000 int ans[13]; char rright[12],lleft[12],re[5]; void findx(char str1[],cha原创 2013-08-19 14:40:08 · 817 阅读 · 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 · 785 阅读 · 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 · 1380 阅读 · 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 · 796 阅读 · 0 评论 -
poj-3903 Stock Exchang O(N*logN)
题目来源:http://poj.org/problem?id=3903 睡前水题一道 O(N*logN) 最长上升子序列 #include #include #include #define MAXN 100010 using namespace std; long long a[MAXN],b[MAXN]; int sum=1,n; void find(int x) { in原创 2013-08-14 01:49:54 · 790 阅读 · 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 · 902 阅读 · 0 评论 -
poj-2479 简单DP
题目来源:http://poj.org/problem?id=2479 题目大意就是求一个数组里面的两端连续值得最大和 DP从前往后扫一遍 再从后往前扫一遍 然后求1~i 和i+1~n的和的最大值 注意题目要求必须得最低取两个数 #include #include #define MAXN 50010 #define MIN -10000 using namespace std; i原创 2013-08-15 23:41:02 · 823 阅读 · 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 · 909 阅读 · 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 · 1037 阅读 · 0 评论 -
poj-1200 Crazy Search
题目来源:http://poj.org/problem?id=1200 遍历一遍 主要是判重 用到hash 不是很难 水~ #include #include #include #include #define NUM 257 #define N 16000005 using namespace std; bool hash[N]; int m[NUM]; char s原创 2013-08-16 23:52:51 · 1227 阅读 · 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 · 994 阅读 · 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 · 1455 阅读 · 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 · 788 阅读 · 0 评论 -
poj-2406 Power Strings睡前一水~
http://poj.org/problem?id=2406 睡前一水~ 一看就觉得是KMP的next数组... 然后果然是 #include #include #include #define max 1000010 int n[max]; char str1[max]; int next(char s[]) { n[0]=-1; int j=0,k=-1;原创 2013-08-15 00:36:49 · 1293 阅读 · 0 评论
分享