<>A排列字母

s='WHERETHEREISAWILLTHEREISAWAY' s=list(s) s.sort() print(''.join(s))
<>B寻找整数

tmp.py
i=1 while True: flag=True if i%49!=46: flag=False if i%48!=41: flag=False if i%
47!=5: flag=False if i%46!=15: flag=False if i%45!=29: flag=False if flag: print
(i) i+=1

233598089……不用说肯定是等差数列，再稍微验证一下y=38137680*x+4772009

B.py
mod = [(2, 1), (14, 11), (26, 23), (38, 37), (3, 2), (15, 14), (27, 20), (39,
23), (4, 1), (16, 9), (28, 25), (40, 9), (5, 4), (17, 0), (29, 16), (41, 1), (6,
5), (18, 11), (30, 29), (42, 11), (7, 4), (19, 18), (31, 27), (43, 11), (8, 1),
(20, 9), (32, 25), (44, 33), (9, 2), (21, 11), (33, 11), (45, 29), (10, 9), (22,
11), (34, 17), (46, 15), (11, 0), (23, 15), (35, 4), (47, 5), (12, 5), (24, 17),
(36, 29), (48, 41), (13, 10), (25, 9), (37, 22)] i = 0 cha = 38137680 while True
: flag = True num = cha*i+4772009 for x, y in mod: if num % x != y: flag = False
break if flag: print(num) break i += 1 # 2022040920220409
<>C纸张尺寸

name = input() A0x, A0y = 1189, 841 if name == 'A0': print(A0x) print(A0y) else
: cnt = int(name[1]) for i in range(cnt): A0x, A0y = A0y, A0x//2 print(A0x)
print(A0y)
<>D数位排序

from functools import cmp_to_key def cmp(x, y): hx = getHe(x) hy = getHe(y) if
hx== hy: return x-y return hx-hy def getHe(n): res = 0 while n > 0: res += n %
10 n //= 10 return res n = int(input()) m = int(input()) num = [i for i in range
(1, n+1)] num.sort(key=cmp_to_key(cmp)) print(num[m-1])
<>E蜂巢

<>F消除游戏

s = list(input()) pre = s f = False for i in range(pow(2, 64)): flag = [False]*
len(s) for j in range(1, len(s)-1): if s[j] == s[j-1] and s[j] != s[j+1]: flag[j
] = True flag[j+1] = True if s[j] != s[j-1] and s[j] == s[j+1]: flag[j-1] = True
flag[j] = True for j in range(len(flag)): if flag[j]: s[j] = '' s = list(''.
join(s)) if len(s) == 0: f = True break if pre == s: break pre = s if f: print(
'EMPTY') else: print(''.join(s))
<>G全排列的价值

<>H技能升级

from math import ceil n, m = map(int, input().split()) a = [0] b = [0] dp = [0]
*(m+1) for i in range(n): x, y = map(int, input().split()) a.append(x) b.append(
y) for j in range(1, m+1): index = 0 for k in range(1, n+1): if a[k] > a[index]:
index= k dp[j] = dp[j-1]+a[index] a[index] -= b[index] a[index] = max(a[index],
0) print(dp[m])
<>I最长不下降子序列

<>J最优清零方案

Toolsou
API参考文档