摘要: 没有哨兵的链表: ListSearch(L,k) { x = L.head; while(x!=null && x.key!=k) x = x.next; return x;} ListInsert(L,x){ x.next = L.head; if(L.head!=null) L.head.pre 阅读全文
posted @ 2017-09-04 13:37 Mr.Struggle 阅读(1290) 评论(0) 推荐(0) 编辑
摘要: 上面的是用C++写的简单的一个回合的游戏,现在用Java写一个完整的游戏过程,并在最后有游戏总结。 阅读全文
posted @ 2017-08-29 12:06 Mr.Struggle 阅读(271) 评论(0) 推荐(0) 编辑
摘要: Android Studio有时候会报这种提醒: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation 遇到这种情况,虽然不影响程序的编译,但是对于有些有 阅读全文
posted @ 2017-08-29 08:33 Mr.Struggle 阅读(3540) 评论(0) 推荐(0) 编辑
摘要: Event Log: Executing tasks: [:app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestS 阅读全文
posted @ 2017-08-28 09:37 Mr.Struggle 阅读(872) 评论(0) 推荐(0) 编辑
摘要: #include int main(){ char str; scanf("%c",&str); printf("%d",str); return 0; } 阅读全文
posted @ 2017-04-19 20:57 Mr.Struggle 阅读(11567) 评论(0) 推荐(0) 编辑
摘要: #include int book[10001]; int add[4]; int one[10001]; int two[10001]; void fun(int x){ int temp=x; int y=x; int t=0; while(x){ add[t]=x%10; t++; x=x/10; } ... 阅读全文
posted @ 2017-03-27 20:34 Mr.Struggle 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 思路:题目是很简单的DFS。求出能走到的"."。因此我们完全不需要回溯,只需要遍历下去,每递归一次则结果+1,最后得出答案。 阅读全文
posted @ 2017-03-27 14:46 Mr.Struggle 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 思路:深度搜索全排列,将每两个相连的结果做成表格,得出最小。 阅读全文
posted @ 2017-03-27 12:18 Mr.Struggle 阅读(577) 评论(0) 推荐(0) 编辑
摘要: 题目大意:有一个4*4的方格,每个方格中放一粒棋子,这个棋子一面是白色,一面是黑色。游戏规则为每次任选16颗中的一颗,把选中的这颗以及它四周的棋子一并反过来,当所有的棋子都是同一个颜色朝上时,游戏就完成了。现在给定一个初始状态,要求输出能够完成游戏所需翻转的最小次数,如果初始状态已经达到要求输出0。 阅读全文
posted @ 2017-03-24 12:15 Mr.Struggle 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 在一个map[100][100]中0代表空地,1代表人。僵尸能够上下左右感染,每五秒感染成功一次,求出最后感染需要的时间,即存活的人。 阅读全文
posted @ 2017-03-23 14:34 Mr.Struggle 阅读(364) 评论(0) 推荐(0) 编辑