摘要: 这题,看到别人的解题报告做出来的,分析:大概意思就是:数组sum[i][j]表示从第1到第i头cow属性j的出现次数。所以题目要求等价为:求满足sum[i][0]-sum[j][0]=sum[i][1]-sum[j][1]=.....=sum[i][k-1]-sum[j][k-1] (j1 1 16... 阅读全文
posted @ 2015-08-07 10:35 海上的风 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 判断n朵雪花中,是否有完全一样的雪花。简单的hash,将雪花的六个边的权值加起来,记为sum,将sum相等的雪花归为一类,再在这里面根据题意找完全相同的,判断顺时针或者逆时针的所有角是否一模一样。#include#includeint MOD=19999;std::vector snow[20000... 阅读全文
posted @ 2015-08-06 12:27 海上的风 阅读(626) 评论(0) 推荐(0) 编辑
摘要: 利用归并排序统计逆序数,利用归并求逆序在对子序列s1和s2在归并时(s1,s2已经排好序),若s1[i]>s2[j](逆序状况),则逆序数加上s1.length-i,因为s1中i后面的数字对于s2[j]都是逆序的。 1 #include 2 #include 3 int N; 4 int num... 阅读全文
posted @ 2015-08-05 10:02 海上的风 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 题意;寻找中位数利用快速排序来寻找中位数。 1 #include 2 using namespace std; 3 int N; 4 int op[10000]; 5 int Median(int left,int right,int pos){ 6 int l=left-1,r=left... 阅读全文
posted @ 2015-08-03 11:47 海上的风 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 字符串子序列查找问题,设置两个指针,一个指向子序列,另一个指向待查找的序列,查找个字符串一次即可判断。 1 #include 2 #include 3 using namespace std; 4 char s[100002]; 5 char t[100002]; 6 int main() { ... 阅读全文
posted @ 2015-08-01 10:20 海上的风 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 大致题意: 给出n个长度为60的DNA基因(A腺嘌呤 G鸟嘌呤 T胸腺嘧啶 C胞嘧啶)序列,求出他们的最长公共子序列使用后缀数组解决 1 #include 2 #include 3 char str[6200],res[6200]; 4 int num[6200],loc[6200]; ... 阅读全文
posted @ 2015-07-31 10:10 海上的风 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Time Limit:2000MSMemory Limit:65536KTotal Submissions:22541Accepted:8220DescriptionYou, as a member of a development team for a new spell checking pro... 阅读全文
posted @ 2015-07-29 12:29 海上的风 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Time Limit:2000MSMemory Limit:32768KTotal Submissions:24788Accepted:12922DescriptionA power network consists of nodes (power stations, consumers and d... 阅读全文
posted @ 2015-07-28 13:52 海上的风 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Time Limit:1000MSMemory Limit:65536KTotal Submissions:5949Accepted:2053Special JudgeDescriptionAs you know, all the computers used for ACM contests mu... 阅读全文
posted @ 2015-07-27 15:16 海上的风 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Time Limit:1000MSMemory Limit:65536KTotal Submissions:17258Accepted:9386DescriptionBessie wants to navigate her spaceship through a dangerous asteroid... 阅读全文
posted @ 2015-07-26 10:11 海上的风 阅读(176) 评论(0) 推荐(0) 编辑