题解列表

筛选

python解题,清晰易懂

摘要:解题思路:首先判断字符串能否构成回文,回文的本质是对称;1、对于字符个数为偶数的字符串,所有的字母都是成偶数出现的,如果不是,直接输出Impossible2、对于字符个数是奇数的字符串,有且仅有中间的……

2821: 开关灯

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

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!}$$ ……

2923: 病人排队

摘要:```cpp #include using namespace std; typedef struct a { char m[20]; int age; }T; int……