withopen('output.txt', 'r') as file: lines = file.read().splitlines() flag = '' mx = 0 vis = [0] * 100 lines.reverse() for line in lines: x = line[line.find("unicode(substr(flag,") + len("unicode(substr(flag,") : line.find(",1)) FROM secrets)")] if x.isdigit(): x = int(x) mx = max(mx, x) if vis[x]: continue tem = int(line[line.find("FROM secrets)>") + len("FROM secrets)>") :]) ifnot vis[x]: vis[x] = tem for i inrange(1, mx + 1): print(chr(vis[i]), end='') ''' KODUG|Jg`Z0v`dp`OOU`xs2u3`B`6d2jpu`2u`2s`sp0pOOp0p`HBRE`5`U`3`g2od`ui26`gmag~ JNCTF{If_Y/u_co_NNT_wr1t2_A_5c1iot_1t_1r_ro/oNNo/o_GAQD_4_T_2_f1nc_th15_fl`f} IMBSEzHe^X.t^bn^MMS^vq0s1^@^4b0hns^0s^0q^qn.nMMn.n^F@PC^3^S^1^e0mb^sg04^ek_e| JNCTF{If_Y0u_do_NOT_wr1t3_A_5c2ipt_1t_1s_so0nOOn0o_HARD_4_U_2_f1nd_th15_flag} '''
import gmpy2 from Crypto.Util.number import long_to_bytes
n = 299487015341597647919776121004167231949688268241700414027108990830625623733773719845841268481813362766547912866733711608177564250583355016088619602664748425336481765034201744572985159895585715150798269166534598956939724628696559498880597219784298678035926538950792013309608367104567539694805267059251508650074879211671636277899101015682266724064486585722087645838229287808682200953448105025969146455228490015983463746790376132783796872114120190783210924155244559381221390948899033151290151152600368322574929968834669432260194965876835069287868333462555623127602208275637571642586991525702340484853548458548057993639750566860524849624229544573184492710462829280342457207433467447389201079678219686250530932773758629428257347183339748908201954402303 e = 65537 c = 173280870300519923715203696834882119083542571140839028806768298820015863852835794226059877700906545110752776137513745886446530644296244068573533415866288372258806488689702896105169105563661309394552655714439116657949182579256607803282002619932851022083044252527626831071719084726862098167058504014857808959509507079927043329860218143205867802447678657763092502703595859068700554763976014721402041206266622977798828412773984216149947581746621557407684424045536228695940316363053758694192430323960905458863919028226745439720770512594999441599361470532712341687933197440708229732759256063243580119155040005536274041077293091976606018500585881239869658926701105111190472713681295382152192237128324734905038277701951508078229426733519689307305874608135
# 计算n的平方根 root = gmpy2.isqrt(n)
# 在附近寻找p和q p = root whileTrue: p = gmpy2.next_prime(p) # 找下一个素数尝试 if n % p == 0: q = n // p break print(p) print(q)