• 2024-03-30E. Nearly Shortest Repeating Substring
    #include<iostream>#include<algorithm>#include<cstring>#include<cmath>usingnamespacestd;intn,m;intmain(){ cin>>n; while(n--) { //strings; cin>>m; strings; cin>>s; intres=m; f
  • 2024-03-29E. Nearly Shortest Repeating Substring
    原题链接题解1.模拟题,注意细节2.时间复杂度\(O(n·sqrt(n))\)code#include<bits/stdc++.h>usingnamespacestd;intn;strings;intcheck(intlen){intflag=0;for(intk=0;k<len;k++){inta[26]={0};for(inti=k;i<n;i+=len)
  • 2023-09-051521A - Nastia and Nearly Good Numbers
    A.NastiaandNearlyGoodNumbershttps://codeforces.com/problemset/problem/1521/A"""思路:1.就是普通的打印,NO的情况是只有b=1的时候才会出现,其他的都是YES,如果不想再继续分情况就把a*b放在中间做y,或者做x也可,避免(b-1)=1,最后要x+y=z"""forlinein[*open(0)
  • 2023-04-21Redis 为何使用Nearly LRU 算法淘汰数据
    Redis使用该LRU算法淘汰过期数据吗?不是的。由于LRU算法需要用链表管理所有的数据,会造成大量额外的空间消耗。大量的节点被访问就会带来频繁的链表节点移动操作,从而降低了Redis性能。Redis的内存空间是很宝贵的,而维护LRU的双向链表需要使用比较多的额外空间,至少需要一
  • 2023-02-08Codeforces Round #720 (Div. 2) A. Nastia and Nearly Good Num
    problemA.NastiaandNearlyGoodNumberstimelimitpertest1secondmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputNastiahas2p
  • 2022-12-08S1 - Lesson 81 - 82
    WordsbathhaveabathHehadabathat11:00PMlastnight.showerhaveashower nearlynearI'mnearlyready.Inearlydie. readyDinnerisready.Wea