Tag:Denominator

  • He problem record – Combinatorial Mathematics

    Time:2022-4-5

    Binary number 2 ^ k Canon hard(worth doing!) analysis For condition “as”2kHexadecimal number, except the last digit,rEach bit of is strictly smaller than the one adjacent to its right“NamelyNumbers from left to right are in ascending order That is, find the combination number(since the scheme corresponding to the combination number is disordered, we can regard […]

  • 2021 national college student information security competition Anhui race – network attack and defense track – some WP crypto cross_ Fire

    Time:2022-3-22

    subject Cross_Fire.py from gmpy2 import * from libnum import s2n,n2s from Crypto.Util.number import * from flag import plaintext assert(len(plaintext)>128) e=65537 m=s2n(plaintext) p=getPrime(500) q=getPrime(1024) r=getPrime(1024) hint1=p*q*r hint2=next_prime(p)*next_prime(q)*next_prime(r) n=next_prime(123*p+456)*next_prime(233*q+233)*next_prime(666*r+666) c=pow(m,e,n) print(“hint1=”,hint1) print(“hint2=”,hint2) print(“e=”,e) print(“n=”,n) print(“c=”,c) ”’ hint1= 66597706438052968602907975635364474124624609040691375744383573309100970537667852695911406578339583406993354597653539587007399024156000284162006381513057917653763467490913961403796256103799712489840324677890516295291754752667080587689619591977796148937147026181153407872286012339573004262967216008992456987530280248046317633785368985937352761743401538167742790063446090181640923337990535120783172231525752911772643973809736013911022053243030289179238536988831429875919863032051710061637295482848897179403927441453047333367742504111531477527219109139209305898423562329209375385774722090035022238350104808001927840789351874748994613148197348389169808276135120368108948370654768586592518609889834086412071206692748953099899446867217942417300125520378227882738726940028929 hint2= 66597706438052968602907975635364474124624609040691375744383573309100970537667852695911406578339583406993354597653539587007399024156000284162006381519250037838090700817357286993539595751890863552857025186501118668940000586180857161834771657275281213521087010590085823066429019242511957345355841205805490396285530197202608369351669705515187871274740384884445010749950651326231261308185878145343225072286358030343013074077614396504748731540529394175170653286604110001303387433196918194353309815286558369700754725062771941489664316582212235229725924291159030267475029526286194732206037792356401019048507530494720324382797923052122766854647054667572207470351698834488250064200327557388850421313632751275068766021705342276955127790709872384961830995521889674866200643581197 e= 65537 n= 1271143363426234578109032622706784368982452702551117975547220359092039459949589311614475250751670324493441017909825758822014002389769016887770094631267325830636300148439767061540517538240094507617502786636783685853116121519909167755693185341466272016646232460012649033718198945340871434729792726475237884312244749128647675044166254114409979208613136490968091271215324179363007030770031883104198634577994666369930225951242263540549447415742095183638116238138212512007206154136596565735565134655180583298422538746349678634986942613303728294063886412713958813109459261894779056221585991240656450995515329105180293668452080201635903397760758605883754955173299769359099672851020901544947845931039456152020654355740641530636597180573996251235682717406311406638139251493213898068501 c= 1216485134271178449567116916754420573073303455397620989326464150108908572336526711707238151485187836142308657852844139181641136164876989706372528330194558764108985905734554870749686706876362171680539349216110583849976294434959121174943229853669205013854742739444539161076289486434305028669545715151531610132849739705231210851708893517910447015945450432744842995436173783966889593804335503774508824344205419870078981016701436069437155486571657204182510954434683255699530711440688659074538879785922444601494725802905576491078834520957416860895991743319707987718280613091465577249499325647665822748760483739502978877174961037108839466736686647462799492964587695553596641935803152814769663732674949417986994233658218593205643014847168221928973615157533648368075119704854913178864 ”’ 0x01 continued fraction Continued fraction script from Crypto.Util.number import * […]

  • Distributed cache (with code)

    Time:2021-3-5

    It’s another company that didn’t start work with a red envelope!!! problem analysis Through the above dialogue, can you guess the reason for all cache penetration? Before answering, let’s take a look at the specific code of cache policy Cache server IP = hash (key)% number of servers One more thing to say here is […]

  • C practical exercise topic 24 – sum of series

    Time:2020-9-29

    Title:There’s a sequence of fractions: 2 / 1, 3 / 2, 5 / 3, 8 / 5, 13 / 8, 21 / 13… Find the sum of the first 20 items in this sequence. Program analysis:Please grasp the changing law of numerator and denominator. example: #include int main() { int i,t; float sum=0; float a=2,b=1; […]

  • Machine learning naive Bayes

    Time:2020-4-1

    Label: Machine Learning 1.Bayes formula is a commonly used calculation method in machine learning. For example, the probability of a hitting the target is 0.4, and the probability of B hitting the target is 0.8. Now someone has hit the target, ask the probability of a hitting. This is very easy to calculate, P = […]

  • Calculate the approximate value of π

    Time:2020-3-1

    The calculation formula of lower π is checked     All denominators are odd numbers. The odd numbers are added and the even numbers are subtracted     The more calculations, the closer