题解列表

筛选

2821: 开关灯

摘要:```cpp #include using namespace std; int a[5001],n,i,j,m; int main() { cin>>n>>m; boo……

2875: 回文子串

摘要:```cpp #include #include using namespace std; bool dp[500][500]; int main() { char s[500]……

1214: 恺撒密码

摘要:```cpp #include using namespace std; int main() { string str; while(getline(cin,str)) ……

1215: 愚蠢的摄影师

摘要:```cpp #include using namespace std; int main() { int N,A[55]={1,1,2}; for(int i=3;i>N……

1216: 成绩转换

摘要:```cpp #include using namespace std; int main() { int n; while(cin>>n) switch(n/……

1217: 换位置

摘要:```cpp #include using namespace std; int main() { int n,i; cin>>n; while(n--) {……

【Python解法】A+B+C+D

摘要:#### 思路: 隔板法,即往 `e-1` 个间隔中放入3个隔板,因此结果为: $$\large \tbinom{e-1}{3}=\frac{(e-1)(e-2)(e-3)}{3!}$$ ……