自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 洛谷 P1423 小玉在游泳 python

k = float(input())n=1s=2s1=2while (s<k):n+=1s1=0.98*s1s+=s1if s>=k:print (n)

2020-08-25 14:29:35 837

原创 洛谷 A+B Problem (python)

s=input().split()a=int(s[0])b=int(s[1])print(a+b)

2020-08-25 14:19:42 595

原创 洛谷 P1739 表达式括号匹配 这题还要优化

import syscharacter=input()chLen=len(character)count=0for i in range(chLen):ch = character[i]if ch==’(’:count=count+1elif ch==’)’:count=count-1elif ch==’@’:breakif count==0:print(‘YES’)else :print(‘NO’)

2020-08-25 14:14:00 208

原创 csp 二十四点

n = int(input())for i in range(n):str = input().replace(‘x’, ‘*’).replace(’/’, ‘//’)print(“Yes” if eval(str) == 24 else “No”)

2020-08-25 09:48:51 142

原创 洛谷 P1426 小鱼会有危险吗(python)

s,x=map(int, input().split())v=7r=0a=s+xb=s-xwhile v!=0:    if r>=b and r<=a:        v*=0.98        r+=v        if r>s

2020-08-23 11:26:38 309

原创 洛谷P1422 小玉家的电费(python)

total = int(input())if total <= 150:amount = total0.4463elif 150 < total <= 400:amount = 1500.4463+(total-150)0.4663elif total > 400:amount = 1500.4463+250*0.4663+(total-400)*0.5663print(’%.1f’ %amount)

2020-08-23 11:23:53 376

原创 洛谷P1706 全排列问题

import itertoolsn=int(input())array=[n for n in range(1,n+1)]row = list(itertools.permutations(array))for x in row:for y in x:print(’ ‘+str(y),end=’’)print()

2020-08-22 20:24:02 158

原创 洛谷 P1424 小鱼的航程(改进版)

n,k=map(int,input().split())s=0for i in range(0,k):if n!=6 and n!=7:s+=250if n==7:n=1else:n+=1print(s)

2020-08-22 20:14:35 381

原创 洛谷 P2705 小球

r,b,c,d,e=map(int,input().split())if c+d>e+e:sum=rc+bdelif r>b:sum=b2e+(r-b)celse:sum=r2*e+(b-r)*dprint(sum)

2020-08-22 20:12:48 185

原创 洛谷 P5706 【深基2.例8】再分肥宅水

t,n=input().split() #毫升肥宅快乐水a=float(t) #用于将整数和字符串转换成浮点数。b=int(n)s=a/bk=2*bprint(’%.3f\n%d’ %(s, k)) #严格精确到小数点后 3 位

2020-08-22 20:09:26 718

原创 P5716 【深基3.例9】月份天数

year,month = map(int,input().split()) # 输入整型数if month >= 1 and month <= 12: # 月份在1~12 if month in (1, 3, 5, 7, 8, 10, 12): # 大月 day = 31elif month in (4, 6, 9, 11): # 小月 day = 30else:#以下两种情况之一都可以判断是闰年if

2020-08-22 20:04:24 312

原创 洛谷 P2669 金币

k=int(input())//输入有多少天count=0now=1 #意思是现在每天要给多少金币a=0 #意思是持续给now个金币给了几天for i in range(1,k+1):count+=now #发金币了a+=1 #今天的金币给了,所以天数+1if a==now: #如果发够天数了a=0 #重置now+=1 #下会发的金币加一print(count)...

2020-08-22 19:55:08 407

原创 洛谷 P1534 不高兴的津津(升级版)

n=int(input()) #n是津津学习的天数j=0 #当天的不高兴值h=0 #累加不高兴值for i in range(1,n+1): #循环a,b=map(int,input().split()) #输入当天上学时间和课外补习的时间j=j+a+b-8 #记录当天的不高兴值h+=j #累加不高兴值print(h)...

2020-08-22 19:50:42 517

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除