题解列表
2037: 字符串比较,C语言HashMap的实现
摘要:解题思路:计算字符串的哈希值函数拉链法解决哈希冲突注意事项:参考代码:#include <stdio.h>
#include <stdlib.h>
#include <string.h>
……
C语言代码,数组循环出圈
摘要:解题思路: 定义一个长度为n的数组,表示n个人,初始值为1,表示未出圈,0表示已出圈。利用while循环,从头开始报数,每一次先判断这个人有没有出圈。如果没有出圈,就报数,并判断报的……
1643: 蓝桥杯算法训练VIP-最大体积 完全背包问题变种
摘要:解题思路:类似完全背包问题,如果序列中的数不互质,那么就有无限多个。
> 证明:设序列$${a_i}$$中的数的最大公约数为k(k≠1),则可设
$$a_1b_1+a_2b_2+. ..+a_nb……
题解 1231: 杨辉三角
摘要:```cpp
#include
#include
using namespace std;
void generate(int numRows);
int main()
{
int……
完数判断,只用for循环
摘要:#include<stdio.h>int main(){ int n,j,i,temp; scanf("%d",&n); for(i=3;i<=n;i++){ temp……