上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 21 下一页
摘要: 4753: Lydsy2351 Matrix Description 给定一个M行N列的01矩阵,以及Q个A行B列的01矩阵,你需要求出这Q个矩阵哪些在原矩阵中出现过。 所谓01矩阵,就是矩阵中所有元素不是0就是1。 Input 输入文件的第一行为M、N、A、B,参见题目描述。 接下来M行,每行N个 阅读全文
posted @ 2018-05-04 19:29 lmjer 阅读(379) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; const int maxn=100000+10; const int p=99991; int a[7]; bool check[maxn]; int next[maxn],adj[maxn]; int snow[maxn][10]; int tot; int H(int x[]){ int h1=0,... 阅读全文
posted @ 2018-05-01 11:46 lmjer 阅读(220) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; const int maxn=1000000; int q[maxn],a[maxn]; int main(){ int n; int m; scanf("%d%d",&n,&m); for (int i=1;i=a[i]) r--;//保证队列的单调性,即保证队... 阅读全文
posted @ 2018-05-01 10:05 lmjer 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 问题试求至少用几个双端队列可排序 那么我们不妨换过来思考,将数列排好序后,再来找队列个数 阅读全文
posted @ 2018-05-01 09:05 lmjer 阅读(300) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std; const int maxn=1000000; int Q1[maxn]; int Q2[maxn],r1,r2; int sum[maxn],dp[maxn]; int main(){ int n; while(scanf("%d",&n)!=EOF){ ... 阅读全文
posted @ 2018-04-30 20:15 lmjer 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 设a[i][j]表示将矩阵压缩成线性序列的前缀和 那么我们在做dp时枚举起点 i 与终点j 最内层枚举行号,那么可以一行一行的累加, 最后更新答案即可 阅读全文
posted @ 2018-04-30 15:51 lmjer 阅读(920) 评论(0) 推荐(1) 编辑
摘要: 题意:进制转换,把a进制转换为b进制。 如果数据不大的话,那么这个题还是很简单的,但这个题就是数据范围太大,所以这里可以采用短除法来做。 关于短除法,就是把每一位(这里指的每一位是指个位十位之类的)除以要转换的进制的余数在乘以当前进制的值加到下一位去,当前位的值就为商,然后这样一直进行到最后一位(也 阅读全文
posted @ 2018-04-29 21:40 lmjer 阅读(1728) 评论(0) 推荐(0) 编辑
摘要: x坐标排序后-相应第为第几个 若本来就相邻减后值相同 如 2 3 4 8 9 减后 1 1 1 4 4 所以往中位数移就好 阅读全文
posted @ 2018-04-29 12:00 lmjer 阅读(857) 评论(0) 推荐(0) 编辑
摘要: Description 有n个小朋友坐成一圈,每人有ai个糖果。每人只能给左右两人传递糖果。每人每次传递一个糖果代价为1。 有n个小朋友坐成一圈,每人有ai个糖果。每人只能给左右两人传递糖果。每人每次传递一个糖果代价为1。 Input 第一行一个正整数n<=1000000,表示小朋友的个数.接下来n 阅读全文
posted @ 2018-04-29 10:58 lmjer 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Corral the Cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1196 Accepted: 502 Description Farmer John wishes to build a corral for his 阅读全文
posted @ 2018-04-29 09:56 lmjer 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 21 下一页