• 2024-06-03【Python】成功解决TypeError: string indices must be integers
    【Python】成功解决TypeError:stringindicesmustbeintegers 下滑即可查看博客内容
  • 2024-05-27A Simple Problem with Integers(C++)
     【题目描述】这是一道模板题。给定数列 a[1],a[2],…,a[n] ,你需要依次进行q 个操作,操作有两类:C、lrx :给定 l,r,x ,对于所有 i∈[l,r] ,将 a[i] 加上 x (换言之,将 a[l],a[l+1],…,a[r] 分别加上 x );Q、lr :给定l,r ,求 ∑ri=la[i] 的值(换言之,求 a[l]+a[l+
  • 2024-04-29SystemVerilog -- 2.2 Data Types ~ Signed integers,byte
    SystemVerilog'integer'and'byte'除了verilog支持的所有数据类型外,SystemVerilog还具有许多其他2-state的数据类型。现代testbench中最常用的数据类型是bit、int、logic和byte。integer整数是没有小数部分的数字,换句话说,它们是整数。SystemVerilog有三种新的signed数据类
  • 2024-04-16扩展中国剩余定理证明及例题 Strange Way to Express Integers
    前置知识中国剩余定理(CRT),逆元;EXCRT是什么我们知道对于\[\begin{equation} \begin{cases} x\equivc_1\(mod\m_1)\\ x\equivc_2\(mod\m_2)\\ .\\ .\\ .\\ x\equivc_i\(mod\\m_i)\\ \end{cases}\end{equation}\]一个一元线性同余方
  • 2024-04-15扩展中国剩余定理证明及例题 Strange Way to Express Integers
    前置知识中国剩余定理(CRT),逆元;EXCRT是什么我们知道,对于对于\[\begin{equation} \begin{cases} x\equivc_1\(mod\m_1)\\ x\equivc_2\(mod\m_2)\\ .\\ .\\ .\\ x\equivc_i\(mod\\m_i)\\ \end{cases}\end{equation}\]一个一元线性
  • 2024-04-14[POJ2891]Strange Way to Express Integers公式推导
    没啥事干,想着推个式子玩玩。题目链接题意不过多赘述,直接上过程:由题意得\[\begin{cases}x\equiva_1\,(mod\,\,n_1)\\x\equiva_2\,(mod\,\,n_2)\end{cases}\]展开得\[x=k_1·n_1+a_1=k_2·n_2+a_2\dots①\]移项得\[k_1·n_1=(a_2-a_1)+k_2·n_2\]\[k_1·n
  • 2024-04-09状压dp——Disease Manangement 疾病管理
    题目描述Alas!AsetofD(1<=D<=15)diseases(numbered1..D)isrunningthroughthefarm.FarmerJohnwouldliketomilkasmanyofhisN(1<=N<=1,000)cowsaspossible.IfthemilkedcowscarrymorethanK(1<=K<=D)differentd
  • 2024-03-06List集合
    ListList集合的特点有序、可重复、有索引。Listremove重载方法的细节List的remove方法有两个案例一publicstaticvoidmain(String[]args){List<Integer>integers=newArrayList<Integer>();integers.add(1);integers.add(2);intege
  • 2024-02-25POJ--3468 A Simple Problem with Integers(线段树/树状数组)
    记录11:032024-2-25http://poj.org/problem?id=1961线段树树状数组把区间增加转变为单点增加,利用两个树状数组\(c_0和c_1\)将”Clrd"转化为在树状数组\(c_0\)中,把位置l上的数加d在树状数组\(c_0\)中,把位置r+1上的数减d在树状数组\(c_1\)中,把位置l上的数
  • 2024-02-11题解 ABC336G【16 Integers】
    萌萌BEST定理练习题。赛时几乎做出来了,但写挂了,现在在火车上没事干就给补了。考虑建图,图中共有\(8\)个节点,节点的编号是\((\mathbb{Z}/2\mathbb{Z})^3\)的每个元素。对于每个四元组\((i,j,k,l)\in(\mathbb{Z}/2\mathbb{Z})^4\),在图中连\(X_{i,j,k,l}\)条\((i,j,k)\to(j
  • 2024-02-01CF920 G. List Of Integers
    \(t\)组询问,求第\(k\)个大于\(x\)且与\(p\)互质的数。看到第\(k\)大这个东西,首先想到二分答案。令当前的二分中点为\(m\),那么如果\([x+1,m]\)中与\(p\)互质的数大于等于\(k\)个,往下缩小二分范围。否则往上缩小二分范围。同时,求\([x+1,m]\)中与\(p\)
  • 2024-01-20AtCoder Beginner Contest 336
    AtCoderBeginnerContest33657秒切A,75秒切B。然后C就卡了,没想到五进制,二分答案加数位DP判断过了。用了半个小时。DE读完题,发现D可做。小推了一下发现可以维护线段树。很快写完过了样例。第一发罚时,\(+1\)和\(-1\)写反了。第二发罚时,把那个“金字塔”写成了
  • 2024-01-17[AGC010E] Rearranging
    Thereare$N$integerswrittenonablackboard.The$i$-thintegeris$A_i$.TakahashiandAokiwillarrangetheseintegersinarow,asfollows:First,Takahashiwillarrangetheintegersashewishes.Then,Aokiwillrepeatedlyswaptwoadjacentintege
  • 2023-12-25CF1051C Vasya and Big Integers 题解
    Problem-1051E-CodeforcesVasyaandBigIntegers-洛谷感谢女队提交记录推荐给我的一道题\(Orz\)首先\(O(n^2)\)的\(dp\)是simple的,如果你没看出来你可能是像我一样把题目看错了设\(dp_i\)表示考虑前\(i\)个的方案数,转移枚举长度后比较字典序。虽然看
  • 2023-11-04[LeetCode] 2149. Rearrange Array Elements by Sign
    Youaregivena0-indexedintegerarraynumsofevenlengthconsistingofanequalnumberofpositiveandnegativeintegers.Youshouldrearrangetheelementsofnumssuchthatthemodifiedarrayfollowsthegivenconditions:Everyconsecutivepairofint
  • 2023-10-23宝塔:续签SSL证书报错string indices must be integers
    网站SSL证书过期,续签的时候,报错stringindicesmustbeintegers。  处理方法:1.点击左侧首页,选择“修复”; 2.修复之后,重新点击网站,设置>>>SSL>>>续签证书,等待流程通过,点击保存即可。 
  • 2023-10-08Go - Sorting Arrays or Slices
    Problem: Youwanttosortelementsinanarrayorslice.Solution: Forint,float64,andstringarraysorslicesyoucanusesort.Ints,sort.Float64s,andsort.Strings.Youcanalsouseacustomcomparatorbyusingsort.Slice.Forstructs,youcan
  • 2023-09-25[CF704D] Captain America
    题目描述SteveRogersisfascinatedwithnewvibraniumshieldsS.H.I.E.L.Dgavehim.They'realluncolored.Thereare$n$shieldsintotal,the$i$-thshieldislocatedatpoint$(x_{i},y_{i})$ofthecoordinateplane.It'spossiblethattwo
  • 2023-09-09[AGC003D] Anticube
    ProblemStatementSnukegotpositiveintegers$s_1,...,s_N$fromhismother,asabirthdaypresent.Theremaybeduplicateelements.Hewillcirclesomeofthese$N$integers.Sincehedislikescubicnumbers,hewantstoensurethatifboth$s_i$and$s_j
  • 2023-09-04[CF1641D] Two Arrays
    题目描述Samchangedhisschoolandonthefirstbiologylessonhegotaveryinterestingtaskaboutgenes.Youaregiven$n$arrays,the$i$-thofthemcontains$m$differentintegers—$a_{i,1},a_{i,2},\ldots,a_{i,m}$.Alsoyouaregivenanarra
  • 2023-08-23【刷题笔记】29. Divide Two Integers
    题目Giventwointegers dividend and divisor,dividetwointegerswithoutusingmultiplication,divisionandmodoperator.Returnthequotientafterdividing dividend by divisor.Theintegerdivisionshouldtruncatetowardzero.Example1:Input:dividen
  • 2023-08-21北大ACM poj1050 To the Max(C++)
    TotheMaxTimeLimit:1000MS MemoryLimit:10000KTotalSubmissions:32446 Accepted:16930DescriptionGivenatwo-dimensionalarrayofpositiveandnegativeintegers,asub-rectangleisanycontiguoussub-arrayofsize1*1orgreaterlocatedwithi
  • 2023-08-20Number of Beautiful Integers in the Range
    NumberofBeautifulIntegersintheRangeYouaregivenpositiveintegers low, high,and k.Anumberisbeautiful ifitmeetsbothofthefollowingconditions:Thecountofevendigitsinthenumberisequaltothecountofodddigits.Thenumberisdivi
  • 2023-08-13华为OD机试-位运算
     importjava.util.ArrayList;publicclassMain{publicstaticvoidmain(String[]args){Integer[]nums=newInteger[]{3,5,2,8,4};//差异值---》异或运算^//相似值---》与运算&ArrayList<Integer[]>pairs=n
  • 2023-07-31Longest Divisors Interval
    Smiling&Weeping----总有一个人,一直住在心底,却消失在生活里。Givenapositiveintegern,findthemaximumsizeofaninterval[l,