题解列表

筛选

3020: 最大数位置

摘要:参考代码:#include <bits/stdc++.h>using namespace std;int a,sum;int c[1000000];int main(){    cin >>a;   ……

题解 2821: 开关灯

摘要:解题思路:首先,如何确定每盏灯的开关?——可以用1代表初始值“开”。for(int i=1;i<=n;i++) {     light[i]=1; }接下来,如何表示每个人对灯的反向操作?for……

C语言解全排列

摘要:解题思路:注意事项:两种代码,第二种交换的代码由于最终打印顺序不同通过不了此题参考代码:#include <stdio.h>#include <string.h>#include <stdbool.h……

回文串(C++)简单易懂

摘要:参考代码:#include <iostream>#include <string>using namespace std;bool isPalindrome(string str) {    int ……

直方图(C++)简单解

摘要:参考代码:#include <iostream>#include <vector>#include <algorithm>using namespace std;int main() {    int……

石头剪刀布

摘要:# MarkDown编辑器基本使用说明 **如果这是您第一次使用MarkDown编辑器,建议先阅读这篇文章了解一下Markdown的基本使用方法。** ## 实时预览、全屏显示 ![……

石头剪刀布

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h> using namespace std; int n,nb,na,a[10000000],b[10000000],s……