题解列表

筛选

等待戈多 (C语言代码)

摘要:解题思路:用dijkstra算法解决该题。注意事项:无参考代码:#include<stdio.h>#include<stdlib.h>#include<math.h>#include<string.h……

汉诺塔 (Java代码)

摘要:解题思路:  汉诺塔:  拿题目的 n=4来举例:柱子用a,b,c来方便表示.  我们逆向看,即看            当第4个盘子放在c时,此时b一定存放着3个盘子,因为根据题意此时第4个盘子一定……

线段覆盖 (C++代码)

摘要:解题思路:模拟法注意事项:参考代码:#include<bits/stdc++.h> using namespace std; int arr[100000]; int main() { ……

等待戈多 (Java代码)

摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main{private static int k;private static int n;……

矩阵嵌套 (C++代码)

摘要:码一下代码:#include <iostream> using namespace std; int main() {     int N, n, a, b;     int i, j……

汉诺塔 (C语言代码)

摘要:解题思路:用f(n, a, b, c)表示要求解的问题,其含义是有a、b、c三根棒和n只盘,// 且这n个盘叠放在a棒上,依次叠放为大盘在下,小盘在上。借助b棒将n只盘从a棒移到c棒上。// 每次只移……

汉诺塔 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>int  count=0;    void move(char getone, char puton……