上一页 1 2 3 4 5 6 7 8 9 10 ··· 33 下一页
摘要: 链接:https://www.luogu.org/problemnew/show/P4917 天守阁的地板 题目描述 为了使万宝槌能发挥出全部魔力,小碗会将买来的地板铺满一个任意边长的正方形(地板有图案,因此不允许旋转,当然,地板不允许重叠)来达到最大共鸣 现在,她能够买到规格为a∗ba*ba∗b的 阅读全文
posted @ 2018-10-08 21:32 Ed_Sheeran 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 题解: 第一题:水题; #include<bits/stdc++.h> using namespace std; const int M = 2e5 + 10; int n, tot, k, r; bool tag[M]; int vis[M], a[M], b[M]; bool check(int 阅读全文
posted @ 2018-10-07 18:03 Ed_Sheeran 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 题解: 第一题:大模拟,横躺竖躺站立三种状态,对每种状态分别模拟就好了; 我记录每面旋转后对应原来的面,很明显麻烦了,我大模拟写了2个小时,别人40分钟A,DS能力太差了; #include<bits/stdc++.h> using namespace std; const int M = 2005 阅读全文
posted @ 2018-10-06 18:20 Ed_Sheeran 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 题解: 第一题:简单DP, 首先容量会是固定的最多N个数,所以复杂度是N^2的; 先预处理各个容量的等级,dp[ i ][ j ][ 0/1 ] 表示考虑第i个菜时此时容量的等级为j, 0表示上一次没吃, 1表示上一次吃了,然后枚举这次吃没有吃往后刷就可以了; #include<bits/stdc+ 阅读全文
posted @ 2018-10-05 19:04 Ed_Sheeran 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 题解: 第一题 注意初值(选第一天特殊处理); 然后考试的时候读入写错了,耍了两天退化成了SB; #include<bits/stdc++.h> using namespace std; #define ll long long const int M = 2005; ll dp[M][2005], 阅读全文
posted @ 2018-10-05 18:37 Ed_Sheeran 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 第一题: 轮廓线DP,从后往前存;复杂度R*C*2^16; 学习了一波std的写法,非常优美; #include<bits/stdc++.h> using namespace std; const int M = (1<<16) + 1; int dp[2][M], cnt[M], len[130] 阅读全文
posted @ 2018-10-04 17:36 Ed_Sheeran 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 都是神题,一道都搞不出来 #include<bits/stdc++.h> using namespace std; #define ll long long const int M = 5 * 1e5 + 10; int a[M], n, c[M], b[M]; struct node{int l, 阅读全文
posted @ 2018-10-03 13:45 Ed_Sheeran 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题解: 第一题:开始想找循环节,但数据很好卡; 后来想小的一直拿,那么另一个就会出现负数,抵消+打表发现就是2^k在mod(n+m)的值; #include<bits/stdc++.h> using namespace std; #define ll long long ll mod, n, m; 阅读全文
posted @ 2018-09-26 16:45 Ed_Sheeran 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 矩阵取数游戏 链接:https://www.luogu.org/problemnew/show/P1005 对于一个给定的 n \times mn×m 的矩阵,矩阵中的每个元素 ai,j​ 均为非负整数。游戏规则如下: 帅帅想请你帮忙写一个程序,对于任意矩阵,可以求出取数后的最大得分。 n, m < 阅读全文
posted @ 2018-09-25 17:38 Ed_Sheeran 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 题解: 第一题:T可以写成 b^n * S + ( x1*b^0 + x2*b^1 + x3*b^p2 + …… xn*b^n) * a,; n的大小是logT的,我们就可以枚举n, 然后用a拆分剩下的,a拆分时尽量用大的b^n去拆分; 第二题: 比如ai 向 i 连边,表示ai需要和大小为i的数进 阅读全文
posted @ 2018-09-25 17:33 Ed_Sheeran 阅读(95) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 33 下一页