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ICKQAHLEBGHAVOVVPEXIMLFWIYI',
'HGTEEIISFGIUEUOWXVTPJDVACYQYFQUCXOXOSSMXLZDQESHXKP',
'FEBZHJAGIFGXSMRDKGONGELOALLSYDVILRWAPXXBPOOSWZNEAS',
'VJGMAOFLGYIFLJTEKDNIWHJAABCASFMAKIENSYIZZSLRSUIPCJ',
'BMQGMPDRCPGWKTPLOTAINXZAAJWCPUJHPOUYWNWHZAKCDMZDSR',
'RRARTVHZYYCEDXJQNQAINQVDJCZCZLCQWQQIKUYMYMOVMNCBVY',
s=0
for i in range(30):
for j in range(50):
#行
for x in range(j+1,50):
if(ord(mat[i][x])>ord(mat[i][j])):
s+=1
#列
for y in range(i+1,30):
if(ord(mat[y][j])>ord(mat[i][j])):
s+=1
#左上右下
for (x,y) in zip(range(j+1,50),range(i+1,30)):
if(ord(mat[y][x])>ord(mat[i][j])):
s+=1
#关键来了，根据题意从左下往右上和从右上往左下算两种方式
for (x,y) in zip(range(j-1,-1,-1),range(i+1,30)):
if(ord(mat[y][x])>ord(mat[i][j])):
s+=1
if(ord(mat[i][j])>ord(mat[y][x])):
s+=1
print(s)#52800


## 算式问题

s=0
for i in range(123,988):
for j in range(123,988):
k=i+j
if(k>123 and k<1000):
m=str(k)+str(i)+str(j)
if('0' not in m and len(set(m))==9):
s+=1
print(s)


## 微生物增值

x,y=10,90
for i in range(1,121):
a=x
if(i%6==0):
x*=2
if(i%2==1):
y-=a
if(i%4==0):
y*=2
print(y) #94371840


## 世纪末的星期

### datetime.datetime()

import datetime
start=datetime.datetime(1999,12,31)
print(start)
print(start.year)
print(start.month)
print(start.day)


### datetime.weekday()

print(start.weekday())


### 题目

import datetime
timedelta=datetime.timedelta(days=1)
start=datetime.datetime(1999,12,31)
while(start.year<9999):
if(int(start.year)%100==99 and start.month==12 and start.day==31 and start.weekday()==6):
print(start.year)
break
start=start+timedelta


## 第39级台阶

s=0
for i in range(1,40):
for j in range(2,40,2):
if(i+j==39):
mat=[]
for x in range(i):
mat.append('1')
for y in range(j//2):
mat.append('2')
if(len(mat)%2==0):
num1=1
num2=1
k=1
start=i+j//2
end=j//2
for z in range(start,end,-1):
num1*=z
num2*=k
k+=1
s+=num1//num2
print(s)


## 六角填数

m=[2,4,5,6,7,9,10,11,12]
arr=list(pm(m))
i=0
while(1):
a=1+m[0]+m[1]+m[2]
b=m[2]+m[3]+m[4]+m[5]
c=1+m[7]+m[6]+m[5]
d=8+m[0]+m[7]+m[8]
e=8+m[1]+m[3]+3
f=3+m[4]+m[6]+m[8]
if(a==b and a==c and a==d and a==e and a==f):
print(m[1])
break
else:
i+=1
m=arr[i]

• 0
点赞
• 2
收藏
• 打赏
• 0
评论
05-24 105
06-16 1265
08-26 3871
03-13 724
12-06 334
07-03 649
12-13 2691
10-26 47
12-06 280

### “相关推荐”对你有帮助么？

• 非常没帮助
• 没帮助
• 一般
• 有帮助
• 非常有帮助

©️2022 CSDN 皮肤主题：1024 设计师：我叫白小胖

Gygert

¥2 ¥4 ¥6 ¥10 ¥20

1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、C币套餐、付费专栏及课程。