题解列表

筛选

换硬币 (C++代码)

摘要:解题思路:        简单搜素。参考代码:#include<bits/stdc++.h> using namespace std; int total, num; void OPT(in……

取石子游戏 (C++代码)

摘要:解题思路:        威佐夫博弈,奇异局势先手必败,非奇异局势后手必败。参考代码:#include<bits/stdc++.h> using namespace std; int main……

连通图 (C++代码)(并查集)

摘要:解题思路:                判断连通图,构建并查集即可注意事项:参考代码:#include <iostream> #include <cstring> using namespace……

内部收益率 (C++代码)

摘要:注意一次循环后,x,y要返回初始值,不然第二次循环会出错#include <stdio.h>#include<iostream>#include<math.h>#include<iomanip>usi……

统计字符数 (C++代码)

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;int main(){ int n,m; cin>>n;……

蛇行矩阵 (C++代码)

摘要:解题思路:定义五个变量,分别用来保存行列的变化值,不需要定义数组,简单清楚!注意事项:注意每行以及每列的规律,用变量来保存数字的变化参考代码:#include <iostream> using na……

成绩排序 (C++代码)

摘要:#include<iostream> #include<algorithm> #include<cstring> using namespace std; struct stu { ch……