canwen
canwen
全部文章
题解
归档
标签
去牛客网
登录
/
注册
canwen的博客
全部文章
/ 题解
(共34篇)
题解 | #有序序列插入一个整数#
#2022/6/1 20:01 n1=int(input()) n2=list(map(int,input().split())) n3=int(input()) n2.append(n3) n2.sort() n4=" ".join(str(i) for i in n2) print(n4)
Python3
2022-06-01
0
216
题解 | #有序序列判断#
#2022/6/1 n=int(input()) N=list(map(int,input().split())) if N==sorted(N) or N==sorted(N,reverse=True): print("sorted") else: &nb...
Python3
2022-06-01
1
291
题解 | #有序序列合并#
#2022/6/1 n,m=map(int,input().split()) n1=list(map(int,input().split())) m1=list(map(int,input().split())) asc=n1+m1 asc.sort() asc1=' '.join(str(i) f...
Python3
2022-06-01
0
235
题解 | #争夺前五名#
#2022/6/1 n=int(input()) list_1=list(map(int,input().split())) list_2=list_1 list_2.sort(reverse=True) list_3=' '.join(str(i) for i in list_2[0:5]) pr...
Python3
2022-06-01
0
188
题解 | #N个数之和#
#2022/5/31 16:30 #方式一:直接使用python中封装的sum函数,对列表进行求和 N=int(input()) list_1=list(map(int,input().split())) #直接使用python中封装的sum函数,对列表进行求和 &nbs...
Python3
2022-05-31
0
210
题解 | #逆序输出#
#2022/5/31 15:59 n=list(map(int,input().split())) list_1=[x for x in reversed(n)] list_2=' '.join(str(i) for i in list_1) print(list_2)
Python3
2022-05-31
0
212
题解 | #魔法数字变换#
#2022/5/23 22:07 n=int(input()) steps=0 while n!=1: try: if n%2==0:  ...
Python3
2022-05-27
0
169
题解 | #牛牛学数列4#
#2022/5/23 21:24 #1 1 #2 1+(1+2) #3 1+(1+2)+(1+2+3) #4 1+(1+2)+(1+2+3)+(1+2+3+4) #n n+1 n=int(input()) sum1,sum2=0,0 for i in range(1,n+1): &nb...
Python3
2022-05-23
0
216
题解 | #牛牛学数列3#
#2022/5/23 21:06 #1 1 #2 1+1/-2 #3 1+1/-2+1/3+1/-4 n=int(input()) sum1,sum2=0,0 for i in range(1,n+1): if i%2==0: &...
Python3
2022-05-23
0
212
题解 | #小乐乐求和#
#2022/5/20 16:57 #循环控制-超出时间复杂度 # n=int(input()) # sum=0 # for i in range(1,n+1): # sum=sum+i # print(sum) #高斯求和公式:和=(首项+末项)x...
Python3
2022-05-20
0
213
首页
上一页
1
2
3
4
下一页
末页