报数问题(约瑟夫环问题) 摘要:```#include #include using namespace std;int findLastPerson (int n){ if(n1){ …… 题解列表 2025年07月02日 2 点赞 0 评论 699 浏览 评分:10.0
2998: 电影票 摘要:解题思路:人数*10注意事项:需要输出空格。参考代码:#include<bits/stdc++.h>using namespace std;int main(){&…… 题解列表 2025年06月29日 2 点赞 1 评论 787 浏览 评分:0.0
c语言解决 小九九 题号1671 解题思路:For循环嵌套dowhile循环,再嵌套if-else判断。注意事项:在做这个题目中最主要其实就是需要每个左对齐,我之前尝试了别的方法,比如增加/t缩进等,但最后还是发现,直接判断敲空格是最简单的,也比较容易判断为正确的。如果有别的更好的思路欢迎在评论区一起讨论。 题解列表 2025年06月26日 2 点赞 0 评论 865 浏览 评分:6.0
链表合并map(sf13c) 摘要:解题思路:map<int,int>mp;//一个是键,一个是值//map有自动排序特性注意事项:注意map的输入和输出的方式参考代码:#include<bits/stdc…… 题解列表 2025年05月29日 1 点赞 0 评论 837 浏览 评分:10.0
队列queue(sf13a) 解题思路:注意事项:在操作2时,当队列为空时,输出no,且return0(退出);参考代码:#includeusingnamespacestd;intmain(){intn,op,x;//op为操作queueq;cin>>n;//一共有多少个指令while(n- 题解列表 2025年05月29日 0 点赞 0 评论 496 浏览 评分:0.0
连通图(sf14b) 解题思路:注意事项:参考代码:#includeusingnamespacestd;constintN=100005;intfather[N];//找根节点intFind(intx){if(x==father[x])returnx;elsereturnfather[x]=F 题解列表 2025年06月01日 0 点赞 0 评论 397 浏览 评分:0.0
连通图是否连通(sf14a) 解题思路:注意事项:记得压缩路径参考代码:#includeusingnamespacestd;constintN=1005;intfather[N];//找根节点intFind(intx){if(x==father[x])returnx;elsereturnfather[ 题解列表 2025年06月01日 0 点赞 0 评论 436 浏览 评分:0.0
分数线的划定很容易,就像她跟我划清界限一样 摘要:#include <stdio.h>#include <math.h>typedef struct{ &nbs…… 题解列表 2025年06月17日 3 点赞 1 评论 642 浏览 评分:10.0