python|并查集 摘要:```pythonclass UnionFind: def __init__(self, n): self.parents = list(range(n))…… 题解列表 2025年01月14日 0 点赞 0 评论 309 浏览 评分:0.0
2838: 有趣的跳跃解题 解题思路:不进行排序,1~n-1作为数组下标,命中的该元素直接设置为1(默认值为0),如果已经为1了,重新设置直接可以打印Notjolly,退出程序。最后对1-~n-1的数组元素直接判断,看值是否都为1,则打印Jolly,如果其中有一个为0,打印Notjolly,退出。 题解列表 2025年01月13日 0 点赞 0 评论 503 浏览 评分:0.0
出圈直接解法 解题思路:注意事项:同样适用于m大于n的情况。参考代码:#include#include#includeintmain(){intn,m,*flag;while(scanf("%d%d", 题解列表 2025年01月13日 0 点赞 0 评论 482 浏览 评分:0.0
高精度乘法 摘要:解题思路:思路很简单和加法差不多,只不过可能每个位数相乘后怎么加才是重点,重点理解这串代码:```cpp while(ls1>>s2; if(s1.size()…… 题解列表 2025年01月13日 1 点赞 0 评论 766 浏览 评分:0.0
c++++++++++++++++++++++++ 解题思路:注意事项:参考代码:#include#includeusingnamespacestd;structnode{charf;charc;inta;intb;}pai[100];boolcmp(nodepai1, 题解列表 2025年01月13日 0 点赞 0 评论 379 浏览 评分:0.0
简单借位问题 摘要:解题思路:先将字符串s1,s2逆序存储进对应数组a1,a2中,解题思路:先将字符串s1,s2逆序存储进对应数组a1,a2中,如果a1[i]>s1>>s2; for…… 题解列表 2025年01月13日 0 点赞 0 评论 665 浏览 评分:0.0
题解 1234: 检查一个数是否为质数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){ long long …… 题解列表 2025年01月13日 1 点赞 0 评论 534 浏览 评分:10.0
题解 1234: 检查一个数是否为质数 解题思路:注意事项:参考代码:#includeusingnamespacestd;typedeflonglongll;intmain(){lln;cin>>n;if(n<2){cout<<'N';return0;}for(inti=2;i<=n-1;i++ 题解列表 2025年01月13日 0 点赞 0 评论 407 浏览 评分:0.0
编写题解 1234: 检查一个数是否为质数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ long long int n,i,sum=0,t=1; &n…… 题解列表 2025年01月13日 1 点赞 0 评论 449 浏览 评分:0.0
编写题解 2664: 蓝桥杯2022年第十三届省赛真题-求和(注释清晰,简单易懂) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){int n;&nb…… 题解列表 2025年01月13日 7 点赞 0 评论 987 浏览 评分:10.0