3039: 分成互质组(递归) 摘要:解题思路:建立数组v记录组别, 遍历每一个数字, 分别和当前组别每一个数字判断是否有大于1的公约数, 如果没有,在v数组中标记该数字的组别, 如果有有, 递归下一个组别, 如果当前组别比 最大组别大,…… 题解列表 2024年02月12日 0 点赞 0 评论 347 浏览 评分:9.9
反复使用sort函数 摘要:解题思路:反复使用sort函数注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int pa[101];int main(){ int n;…… 题解列表 2024年02月12日 0 点赞 0 评论 245 浏览 评分:0.0
蓝桥杯基础练习VIP-字符串对比 (C) 摘要:注意事项:1.该题目不允许使用gets()函数(在新的C标准中已经废弃),fgets函数会读入'\n'符不是很方便,考虑使用scanf("%s\n%s",&a,&b)。2.该题目不允许…… 题解列表 2024年02月12日 0 点赞 0 评论 385 浏览 评分:9.9
用string类直接秒了 摘要:```cpp #include #include using namespace std; int main() { string str; cin >> str; …… 题解列表 2024年02月12日 10 点赞 0 评论 974 浏览 评分:10.0
: 信息学奥赛一本通T1323-活动选择 摘要:解题思路: 贪心,排序,双指针注意事项:使用pair参考代码:#include<iostream> #include<algorithm> #include<utility> using na…… 题解列表 2024年02月12日 1 点赞 0 评论 180 浏览 评分:7.0
取模,保存上一个打水人时间即可 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n,m; cin>>n>>m; int …… 题解列表 2024年02月12日 0 点赞 0 评论 271 浏览 评分:0.0
注意时间要求 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int ti[501];//n个人打水的时间,下标从1开始int wat[100…… 题解列表 2024年02月12日 0 点赞 0 评论 273 浏览 评分:0.0
先帮助差值小的人完成任务 摘要:解题思路:注意事项:参考代码://设某个人拥有a个积木,需要b个积木。a-b就是积木差。a-b>=0表示这个人的积木足够了,a-b<0表示这个人需要等其它人完成后才能拿到足够的积木//把所有人的积木差…… 题解列表 2024年02月13日 1 点赞 0 评论 213 浏览 评分:0.0
筛选法做题 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int s[10000+1]; //值为1表示下标为 非寂寞数。值为0则表示下标为寂…… 题解列表 2024年02月13日 0 点赞 0 评论 228 浏览 评分:0.0
最大子矩阵 摘要:解题思路:二维前缀和注意事项:参考代码:#include<iostream> #include<algorithm> #include<utility> using namespace std…… 题解列表 2024年02月13日 0 点赞 0 评论 148 浏览 评分:6.0