You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

01_12.py 1.1 kB

12345678910111213141516171819202122232425262728
  1. #1.12 能够拼成多少个单词:
  2. #给出一个由小写字母组成的字符串 s,使用 s 中的字符来拼凑单词 'balloon'(气球)。字符串 s 中的每个字符最多只能被使用一次,求出 s 中的字符最多可以拼凑出多少个单词 'balloon'。
  3. str = "ballloonbalxballpoonopq"
  4. n = len(str)
  5. #字符列表:记录b,a,l,o,n每个字母出现的次数
  6. target_list = [1,1,2,2,1]
  7. #字符列表:记录b,a,l,o,n每个字母出现的次数
  8. letter_count = [0,0,0,0,0]
  9. for i in range(len(str)):
  10. #更新字符列表
  11. if str[i] == 'b':
  12. letter_count[0] += 1
  13. if str[i] == 'a':
  14. letter_count[1] += 1
  15. if str[i] == 'l':
  16. letter_count[2] += 1
  17. if str[i] == 'o':
  18. letter_count[3] += 1
  19. if str[i] == 'n':
  20. letter_count[4] += 1
  21. for i in range(len(letter_count)):
  22. letter_count[i] = letter_count[i]//target_list[i]
  23. count_min = letter_count[0]
  24. for i in range(1,len(letter_count)):
  25. if count_min > letter_count[i]:
  26. count_min = letter_count[i]
  27. print(count_min)

机器学习越来越多应用到飞行器、机器人等领域,其目的是利用计算机实现类似人类的智能,从而实现装备的智能化与无人化。本课程旨在引导学生掌握机器学习的基本知识、典型方法与技术,通过具体的应用案例激发学生对该学科的兴趣,鼓励学生能够从人工智能的角度来分析、解决飞行器、机器人所面临的问题和挑战。本课程主要内容包括Python编程基础,机器学习模型,无监督学习、监督学习、深度学习基础知识与实现,并学习如何利用机器学习解决实际问题,从而全面提升自我的《综合能力》。