题解列表

筛选

最长单词 保证AC

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){     string s,s1[100000];    ge……

迷宫问题(bfs)(queue,pair)

摘要:解题思路:通过宽搜  搜出每一个格子起点的距离 最终输出注意事项:  无 本就很简单的题参考代码:#include<iostream> #include<queue> using namespac……

c++string 可直接比较

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

最简单思路

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

蛇形填数(dfs)

摘要:解题思路:通过dfs填写最方便  详解请看代码注意事项:1、向下和向右都能走时要向右走,需要特判              2、for循环找方向时要按照下左上右的顺序              3、每……

杨辉三角(暴力)

摘要:解题思路:双重循环直接写就行注意事项:参考代码:#include<iostream> using namespace std; const int N=100; int n,a[N][N]; ……

2945: 素数对(简单解)

摘要:AC代码 代码解析: is_prime函数:该函数用来判断一个数字是否为素数。如果数字小于2,直接返回false。然后从2开始,依次遍历到sqrt(num),如果存在某个数能整除num,则返回……

2947(C++简单解)

摘要:AC代码: ```cpp #include using namespace std; void findUnluckyMonths(int w) { int daysInM……

2950: 素数回文数的个数(C++简单解)

摘要:代码解析: isPrime函数:该函数用于判断一个数是否为素数。首先判断如果n小于2,则直接返回false,因为小于2的数不是素数。然后使用一个循环从2开始到sqrt(n)判断是否存在一个数能整除n……

题目 1681: 数据结构-行编辑程序

摘要:解题思路:栈的基本操作中的初始化,入栈和出栈注意事项:见 代码参考代码:#define _CRT_SECURE_NO_WARNINGS 1#include <stdio.h>#include <std……