摘要:
题解: 第一题:水题; #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 阅读全文
摘要:
题解: 第一题:大模拟,横躺竖躺站立三种状态,对每种状态分别模拟就好了; 我记录每面旋转后对应原来的面,很明显麻烦了,我大模拟写了2个小时,别人40分钟A,DS能力太差了; #include<bits/stdc++.h> using namespace std; const int M = 2005 阅读全文
摘要:
题解: 第一题 注意初值(选第一天特殊处理); 然后考试的时候读入写错了,耍了两天退化成了SB; #include<bits/stdc++.h> using namespace std; #define ll long long const int M = 2005; ll dp[M][2005], 阅读全文
摘要:
第一题: 轮廓线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] 阅读全文
摘要:
都是神题,一道都搞不出来 #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, 阅读全文
摘要:
题解: 第一题:开始想找循环节,但数据很好卡; 后来想小的一直拿,那么另一个就会出现负数,抵消+打表发现就是2^k在mod(n+m)的值; #include<bits/stdc++.h> using namespace std; #define ll long long ll mod, n, m; 阅读全文
摘要:
矩阵取数游戏 链接:https://www.luogu.org/problemnew/show/P1005 对于一个给定的 n \times mn×m 的矩阵,矩阵中的每个元素 ai,j 均为非负整数。游戏规则如下: 帅帅想请你帮忙写一个程序,对于任意矩阵,可以求出取数后的最大得分。 n, m < 阅读全文