出圈:重点是怎么在反复遍历一个圈时确定下标问题 摘要:解题思路:本题可以将所有的人从1到m设置好序号,然后放到列表里面,序号存在表示该人尚未出圈,每次遍历时index更新为(index+(m-1))%len(c),保证下标在超过范围时能够正确判断,每一次…… 题解列表 2023年11月08日 0 点赞 0 评论 215 浏览 评分:9.9
编写题解 1160: 出圈(队列) 摘要:解题思路:把m-1个数加到后面之后,删除第一个数即可注意事项:参考代码:while True: try: n,m = map(int,input().split()) …… 题解列表 2023年12月09日 1 点赞 0 评论 208 浏览 评分:0.0
1160: 出圈(好东西哈) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstring> //memset()必备using namespace std;in…… 题解列表 2024年03月12日 0 点赞 0 评论 162 浏览 评分:9.9
猴子选大王(报数问题) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main() { int n,m; while(scanf("%d %d",&n,&m)!=EOF) { int s=0; …… 题解列表 2024年03月18日 0 点赞 0 评论 203 浏览 评分:9.9
无需链表,一维数组循环解决 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int magic(const int n,int cu){ int a[n]; //用数组记录…… 题解列表 2024年03月20日 0 点赞 0 评论 134 浏览 评分:0.0
1160出圈(利用数组遍历解决) 摘要:解题思路:这道题其实最好还是用单项循环链表做时最好的,所以以后学了链表后可以拿这道题练手,下面时模拟遍历的做法。注意事项:参考代码:#include<iostream>using namespace …… 题解列表 2024年07月09日 0 点赞 0 评论 153 浏览 评分:0.0
出圈,人要麻木了,真的出圈了 摘要:解题思路:注意事项:在判断最后一个函数中的迭代器要两次判断尾参考代码:#include <iostream> #include <vector> using namespace std; voi…… 题解列表 2024年08月27日 0 点赞 0 评论 114 浏览 评分:0.0
1160: 出圈 (vector , 公式法) 摘要:解题思路:Vector注意事项:删除元素的位置在末尾的时候,需要注意初始化为0参考代码:#include#include using namespace std; int main() { …… 题解列表 2024年08月31日 0 点赞 0 评论 141 浏览 评分:9.9
循环链表解法(c语言代码) 摘要:我是很不想用链表的,因为每次写完都有一堆bug,因为链表很容易访问到空指针。但是我更不想用数组,数组太费脑子了。 ```c #include #include // 定义链表节点结构体…… 题解列表 2024年08月31日 0 点赞 1 评论 329 浏览 评分:9.9
约瑟夫环比出圈更高大上啊(但是太简单了) 摘要:解题思路:标记淘汰,首尾相连,很简单注意事项:参考代码:#include<stdio.h> int main(void) { int n, m,i; while(scanf("…… 题解列表 2024年12月31日 0 点赞 0 评论 161 浏览 评分:0.0