题解列表

筛选

程序员的总统梦

摘要:解题思路:蒙混过关注意事项:我是彩笔,仅限参考参考代码:   while True:    c = []    a=int(input())    if a==0:        break    e……

python最大配对简单解法

摘要:B=[]n=int(input())A=list(map(int,input().split()))A.sort()  #正序排序(小到大)b=list(map(int,input().split()……

python两行代码通过

摘要:##### 关于找到规律之后python两行代码通过这件事 ```python n,s=map(int,input().split()) print ((int(s)+int(2**(n+1)-……

1127基础解法(Python)

摘要:解题思路:可以用数学原理,也可以当做找规律注意事项:参考代码:n = int(input())cubic = pow(n, 3)square = pow(n, 2)if square % 2 == 0……

数字的处理与判断

摘要:```python while True: try: a = list(map(int, input())) b = a[-1: -7: -1] print(len(a)) ……

年会题解解解

摘要:解题思路:记忆化搜索(深度搜索+动态规划)+树观察题目发现可以将学校各教职工关系构建成一颗树,由题目限制可得,对于树中任意一个节点都应该有1.自己来,学生不来。2.自己不来,学生来或学生不来两种情况,……

1223: 敲七游戏

摘要:解题思路:一行解,融入许多函数,运行很爽。注意事项:参考代码:print(len(set(list(map(lambda x : x+1 if (x % 7 == 0 or '7' i……

python最简短做法

摘要:解题思路: 在一篇博客找到的原理图。可以根据此图设计六个方向,x,y轴方向如图所示。注意事项: 可以注意到点变化的方向只有(1,0)、(-1,0)、(0,1)、(0,-1)、(1,1)、(-1,-1)……

二分法,求阶乘

摘要:解题思路:通过规律发现:5!-> end 0 number is 110-> end 0 number is 215->end 0 number is 3…………注意事项:参考代码:import os……