摘要: /*n个人想玩残酷的死亡游戏,游戏规则如下: n个人进行编号,分别从1到n,排成一个圈,顺时针从1开始数到m,数到m的人被杀,剩下的人继续游戏,活到最后的一个人是胜利者。 请输出最后一个人的编号。Input输入n和m值。m>1。Output输出胜利者的编号。Sample Input5 3Sampl... 阅读全文
posted @ 2015-12-09 21:22 柳下_MBX 阅读(330) 评论(0) 推荐(0) 编辑
摘要: #include #include typedef struct lnode{ int data; struct lnode* next;} node,*linklist;void initlist(linklist &l){ linklist p=(linklist)mallo... 阅读全文
posted @ 2015-12-09 20:49 柳下_MBX 阅读(223) 评论(0) 推荐(0) 编辑
摘要: D.基础数据结构——单链表(2)(链表)Time Limit: 1000 MSMemory Limit: 32768 KTotal Submit: 192 (72 users) Total Accepted: 82 (67 users) Special Judge: No Description19... 阅读全文
posted @ 2015-12-09 18:22 柳下_MBX 阅读(966) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASIBLE -1#define OVERFLOW -2#define LIST_INIT_SIZE 100#... 阅读全文
posted @ 2015-12-09 01:05 柳下_MBX 阅读(766) 评论(2) 推荐(0) 编辑