2811: 救援(Python) 摘要:解题思路:注意事项:参考代码:from decimal import * n = int(input()) t0 = 0 while True: try: x,y,num=map(in…… 题解列表 2023年02月14日 0 点赞 0 评论 493 浏览 评分:0.0
幂的末尾解法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,b; scanf("%d %d",&a,&b); int i; int r=1; for(i=1;i…… 题解列表 2023年02月14日 0 点赞 0 评论 563 浏览 评分:0.0
魔板(BFS+map去重) 解题思路:BFS+map去重,用map存储操作序列。BFS算法通过对当前状态进行操作,并将所有可能的下一状态加入队列,不断扩展状态空间直到找到目标状态。哈希表用于存储操作序列,避免重复搜索相同的状态。参考代码:```cpp#includeusingnamespacestd;//定义两个变量s和f, 题解列表 2023年02月14日 0 点赞 0 评论 792 浏览 评分:9.9
合法c标识符 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ char a[30]; int i; int flag=0; gets(a); if((a[0]>='a…… 题解列表 2023年02月14日 0 点赞 0 评论 544 浏览 评分:0.0
放苹果递归水题 摘要:解题思路:注意事项:参考代码:int apple(int m,int n){ if(n==1||m==0)return 1; 有一个盘子或者没有苹果 else if(m<n)return …… 题解列表 2023年02月14日 0 点赞 0 评论 1179 浏览 评分:6.3
编写题解 3012: 分苹果 摘要:编写题解 3012: 分苹果 ``` #include using namespace std; int main() { int n; cin>>n; cout…… 题解列表 2023年02月13日 0 点赞 0 评论 571 浏览 评分:0.0
编写题解 2772: 苹果和虫子(简单题) 摘要:####秒杀题,随便写 ``` #include using namespace std; int main() { int n,x,y; cin>>n>>x>>y; int a…… 题解列表 2023年02月13日 0 点赞 0 评论 723 浏览 评分:9.9
编写题解 1084: 用筛法求之N内的素数(so easy) ####莫名其妙的就写完了,说实话我都不知道怎么写出来的,就这么莫名其妙的过了。可能是素数题写多了,脑袋没动,手就帮忙写完了。```#includeusingnamespacestd;intmain(){intn;cin>>n;intf=0;for(inti=2;i 题解列表 2023年02月13日 0 点赞 0 评论 622 浏览 评分:0.0
级数求和....... 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int k,i; double s=.0 ; scanf("%d",&k) ; for(i=1;;i++){ …… 题解列表 2023年02月13日 0 点赞 0 评论 603 浏览 评分:0.0
家谱(并查集做法) 解题思路:显然这道题应该使用并查集,但普通的并查集只能合并数字,我们可以用map来代替数组,实现并查集的操作,直接用map把他们的父亲连接起来。参考代码:```cpp#includeusingnamespacestd;mappre;//用map实现并查集stringfind(stringx){//查找 题解列表 2023年02月13日 0 点赞 0 评论 874 浏览 评分:9.9