题解列表

筛选

2810: 鸡尾酒疗法

摘要:解题思路:注意采取循环注意事项:参考代码:# 鸡尾酒疗法n=int(input())b=[]avg=0now=0for i in range(1,n+1):    x,y=(map(int,input……

A star/A * 路径规划算法

#Astar/A*路径规划算法##曼哈顿距离介绍:[详情](https://baike.baidu.com/item/%E6%9B%BC%E5%93%88%E9%A1%BF%E8%B7%9D%E7%A6%BB/743092"详情")曼哈顿距离是种使用在几何度量空间的几何学用语,

必备技法--高精加//vector数组版 + string版

#高精度加法vector版使用vevtor容器容量可变的优势模拟高精度本模板无难点需要注意输出答案之前要反转结果```cpp#include#include#include#include#defineintlonglong//个人习惯usingnamespacestd;vectora,

[蓝桥杯2017年第八届真题-九宫幻方] DFS

##思路:先找出未用的数字有哪些,再进行深搜找出全排列的数,然后放入九宫格中,最后进行检测看是否符合题意```cpp#include#defineULLunsignedlonglong#defineLLlonglong#definePIIpairusingnamespacestd;constintN=

对题2844:数组之间的转化以及数组计算

摘要:解题思路:首先,需要定义一个字符数组,用于输入大整数,并将其储存在数组中;然后再定义一个整型数组,利用ASCII码之间的关系,将字符数组中每个元素减轻‘0’,即可将输入的整数储存在数组中,用来进行后续……

单调栈(可做模板)

##优化版(O(n))###手写栈版#include#includeusingnamespacestd;constintN=5000;inta[N],tt;intmain(void){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);intn;cin

筛素数最全模板

###暴力筛素数(O(sqrt(n)))#include#includeusingnamespacestd;boolprimes(intx){if(x==2)returntrue;for(inti=2;i