考试T2,随便推一推就好了~ code: #include <bits/stdc++.h> #define N 1015 #define mod 998244353 #define ll long long #define setIO(s) freopen(s".in","r",stdin) , freopen(s".out","w",stdout) using namespace std; ll f[N][N&l…
D. Bicolorings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a grid, consisting of $$$2$$$ rows and $$$n$$$ columns. Each cell of this grid should be colored either black o…
/* 给定一个二行n列的格子,在里面填黑白色,要求通过黑白色将格子分为k块 请问有多少种填色方式 dp[j][k][0,1,2,3] 填到第j列,有k块,第j列的颜色, */ #include<bits/stdc++.h> using namespace std; #define ll long long #define mod 998244353 //0全白,1黑白,2白黑,3黑黑 ll dp[][*][],n,k; int main(){ cin>>n>>k; me…
[链接] 我是链接,点我呀:) [题意] 题意 [题解] dp[i][j][k]表示前i列,有j个联通块下,最后一列的状态为k的方案数 k如果为1的话,表示最后一列两个块不一样,k如果为0表示一样 枚举最后一列的情况转移就好 [代码] #include <bits/stdc++.h> using namespace std; const int maxn=1100; const long long mod=998244353; #define ll long long #define mem(…
蒟蒻就切了四道水题,然后EF看着可写然而并不会,中间还WA了一次,我太菜了.jpg =.= A.Vasya And Password 一开始看着有点虚没敢立刻写,后来写完第二题发现可以暴力讨论,因为保证有解,没了 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; char rd[N]; int main () { int T; scanf("%d"…
A:Vasya And Password 代码: #include<bits/stdc++.h> using namespace std; #define Fopen freopen("_in.txt","r",stdin); freopen("_out.txt","w",stdout); #define LL long long #define ULL unsigned LL #define fi first #…
A. Vasya And Password 模拟题,将所缺的种类依次填入"出现次数$ >1 $"的位置,替换掉Ta即可. #include <iostream> #include <cstdio> #include <cstring> using namespace std; const int N = 110; char str[N]; int sum[3][N], n; int inline get(char x){ if(x <=…