题解列表
题解 2975: 1的个数
摘要:```cpp
#include
using namespace std;
int l,a[1001],n,s;
int main()
{
cin>>n;
while(n!……
C++判断闰年详细代码以及注释
摘要:解题思路:最基础的if判断来写注意事项:无参考代码:#include<iostream>using namespace std;int main(){ int a; //定义一个数,作为年……
1098:陶陶摘苹果(C++代码)
摘要:解题思路:简单题,算法难度较低注意事项:参考代码:#include <iostream>using namespace std;int main(){ int arr[10] = {0}; ……
通俗易懂的C++方法
摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main() { int m, n; int s1 = 0; int s2 = 0;……
3080: 信息学奥赛一本通T1335-连通块
摘要:```cpp
#include
using namespace std;
const int N=1001;
int n,m,g[N][N],f[N*N];
int find(int x)
……
铺地毯(二维差分)(内存超限)
摘要:解题思路:
最优解应该是逆序查找,但是这道题也可以用二维差分来做,每次把铺地毯的区域加1,最后的数字就是最上层的地毯编号,区间修改可以使用二分差分来实现,最后查找目标格的数字既是此格的地毯编号。(但……
3125: 局域网(net)
摘要:```cpp
#include
#include
using namespace std;
const int N=101,inf=0x3f3f3f3f;
int n,m,mapp[N][N……
3126: 繁忙的都市(city)
摘要:```cpp
#include
#include
#include
using namespace std;
#define N 301
struct Edge
{
int t……