主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
我能走到对岸吗
2024年4月20日 17:03
击鼓传花(C++) 题解:
P1018
回复 0
|
赞 1
|
浏览 90
#include<bits/stdc++.h> using namespace std; const int N = 110; int n; bool st[N]; vector<int> res; int main() { cin >> n; int cnt = 0; for(int i = 1; i <= n + 1; i ++) { if(res.size() == n) break; if(!st[i]) cnt ++; ...
flipped
2024年4月17日 17:46
击鼓传花 题解:
P1018
回复 0
|
赞 0
|
浏览 133
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> #include <string.h> int main() { int n; scanf("%d", &n); int arr[100] = {0}; int count = 0;//记录表演过得小朋友人数; i...
gzulianxisheng
2024年3月24日 21:12
击鼓传花 题解:队列解题
P1018
回复 0
|
赞 0
|
浏览 253
#include <bits/stdc++.h> using namespace std; int main(){ queue<int> Q; int n; cin >> n; for (int j = 0; j < n; j++) { Q.push(j+1); &n...
我爱陈少熙
2024年3月24日 15:48
击鼓传花 题解:非链表版
P1018
回复 0
|
赞 0
|
浏览 135
#include <iostream> #include<bits/stdc++.h> using namespace std; int main() { int n; scanf("%d",&n); int a[n]; for(int i=0;i<n;i++) { a[i]=i+1; }...
为欢几何
2024年3月24日 15:42
击鼓传花 题解:循环链表,AC
P1018
回复 0
|
赞 0
|
浏览 210
#include<bits/stdc++.h> using namespace std; struct node { int n; struct node *next; }; //创建循环链表 struct node * create(int n) { struct node* head = (struct node*)malloc(sizeof(struct node)); head->next = NULL; ...
sssmw
2024年3月23日 21:03
击鼓传花 (c用数组实现)题解:
P1018
回复 0
|
赞 1
|
浏览 246
#include <stdio.h> #include <stdlib.h> #define N 100 int main() { int n,a[N]={0},count,i,k; scanf("%d",&n); count=n; i=-1; while(count>0){//控制剩余小朋友个数 k=3; &nbs...
1576684866
2024年3月23日 15:00
击鼓传花 题解:
P1018
回复 0
|
赞 0
|
浏览 139
#include <cstdio> using namespace std; #include <string.h> #include <iostream> #include <stdlib.h> typedef struct node { int number; struct node* next; }*LinkList,Node; //遍历链表 void Print(LinkList& L) {  ...
光明守护神
2024年3月10日 15:01
击鼓传花 题解:图解题目意思
P1018
回复 2
|
赞 2
|
浏览 365
1 2 3 4 5 1 2 3 4 5 1 2 4 5 1 2 4 5 1 2 4 1 2 4 1 4 1 4 4 用list写一个循环链表 #include <iostream> #include <list> using namespace std; int main() { { int n; cin >> n; list<int>l; list<int>::iterator it; for (int ...
Cookie‘s AE86
2024年3月16日 09:48
击鼓传花 题解:c++自定义无头节点的循环链表实现
P1018
回复 0
|
赞 0
|
浏览 184
#include<bits/stdc++.h> using namespace std; typedef struct node{ int number; struct node* next; }LiNode, *LiList; int main(){ int n; cin >> n; LiList L = (LiList) malloc(sizeof(LiNode)); L->number = 1; L->next = L; //不带头节点的循环单...
damowanghwj
2024年3月11日 17:01
击鼓传花 题解:队列实现
P1018
回复 0
|
赞 0
|
浏览 214
#include <iostream> #include<cstdio> #include<vector> #include<algorithm> #include<cstring> #include<queue> using namespace std; int main(){ int n ; cin >> n; if(n == 1){ cout << 1 <<endl; return 0; ...
1
2
3
4
题目
击鼓传花
题解数量
36
发布题解
热门题解
1
(无头结点)循环单链表—纯C
2
vector究极无敌简洁版
3
P1018题解 - 链表操作
4
击鼓传花 题解:图解题目意思
5
循环链表解决
6
击鼓传花 题解:用不带头结点的循环链表(带头结点的太麻烦了)
7
击鼓传花 (c用数组实现)题解:
8
击鼓传花 题解:
9
约瑟夫环------vector模拟
10
击鼓传花(约瑟夫环)