题解列表

筛选

回文串(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……

石头剪刀布(微详细)

摘要:“石头剪刀布”#include <bits/stdc++.h> using namespace std; int main() {     int N,NA,NB,a[10000]……

题解 2839: 石头剪刀布

摘要:先仔细读题,理解题目的含义石头剪刀布是常见的猜拳游戏。石头胜剪刀,剪刀胜布,布胜石头。如果两个人出拳一样,则不分胜负。一天,小A和小B正好在玩石头剪刀布。已知他们的出拳都是有周期性规律的,比如:“石头……

分离整数的各个数位

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    int x,a;    cin >> x;    w……

整数去重:vector

摘要:```cpp #include using namespace std; int vis[105]={0};//标记输入是否有重复 int main() { int n; cin>>n;……

数据结构-最小生成树(C++详细解题)

摘要:#### 普利姆(Prim)算法原理: 1. 算法开始时选择一个起始点作为最小生成树的根节点,并将其加入最小生成树中。 3. 对于还未加入最小生成树的顶点,维护一个距离集合(在Prim’s算法中用……