ural2040palindromesandsuperabilities2

小小AI,请多多提携 小小AI,请多多提携     2022-09-02     226

关键词:

题目太坑,发一波纪念一下

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 typedef long long ll;
 4 const int N=5000010;
 5 struct PAM{
 6     int cnt,last;
 7     int a[N][2],l[N],f[N];
 8     char s[N];
 9     PAM(){
10         cnt=f[0]=f[1]=1;
11         l[1]=-1;
12     }
13     int get_fail(int x,int loc){
14         while(s[loc-l[x]-1]!=s[loc])x=f[x];
15         return x;
16     }
17     void insert(int c,int loc){
18         int p=get_fail(last,loc);
19         if(!a[p][c]){
20             int now=++cnt,k=get_fail(f[p],loc);
21             l[now]=l[p]+2;
22             f[now]=a[k][c];a[p][c]=now;
23         }
24         last=a[p][c];
25     }
26 }P;
27 char fuck[N];
28 int main(){
29     scanf("%s",P.s);
30     int n=strlen(P.s);
31     for(int i=0;i<n;++i){
32         int ls=P.cnt;
33         P.insert(P.s[i]-a,i);
34         fuck[i]=(P.cnt-ls?1:0)+0;
35     }
36     puts(fuck);
37     return 0;
38 }

 

arduinorp2040读取adc采样数据

ArduinoRP2040读取ADC采样数据 查看详情

circuitpythonraspberrypipicorp2040自定义机械键盘实例(代码片段)

【CircuitPython】RaspberryPiPicoRP2040MechanicalKeyboard实例本示例基于Thonny开发,所使用的固件是:CircuitPython,区别于MicroPython固件。最近B站某君的瀚文键盘很火热,这里介绍利用RaspberryPiPicoRP2040实现键盘按键定制功能。... 查看详情

arduinorp2040通过调节pwm实现呼吸灯效果

ArduinoRP2040通过调节PWM实现呼吸灯效果 查看详情

micropythonrp2040通过adc调节pwm输出示例(代码片段)

【MicroPythonRP2040】通过ADC调节PWM输出示例🔖RaspberryPiPico引脚功能图🔖YD2040📖RP2040ADC介绍📝RP2040共有5个ADC通道,其中4个是基于12位SAR的ADC:GP26、GP27、GP28和GP29。ADC0、ADC1、ADC2、ADC3的输入信号分别可以连接到GP 查看详情

ural-1901spaceelevators

题目:NowadaysspaceshipsareneverlaunchedfromtheEarth‘ssurface.ThereisahugespaceportplacedinthegeostationaryorbitandconnectedtotheEarthwithcarbonnanotubecables.Peopleandcargoaredeliveredtotheorbitbyelevat 查看详情

ural2089experiencedcoachtwosat

DescriptionMishatrainsseveralACMteamsattheuniversity.Heisanexperiencedcoach,andhedoesnotunderestimatethemeaningoffriendlyandcollaborativeatmosphereduringtrainingsessions.Itusedtobethatway,butoneofthet 查看详情

ural2020trafficjaminflowertown

2020.TrafficJaminFlowerTownTimelimit:1.0secondMemorylimit:64MBHavingreturnedfromSunCity,Dunnotoldallhisfriendsthateveryshortymayhaveapersonalautomobile.Immediatelyafterthatsomanycitizenstookafancyofbe 查看详情

ural1424minibus

MinibusTimelimit:1.0secondMemorylimit:64MBBackgroundMinibusdriverSergeyA.Greedsonhasbecometotallyfamousforhisphenomenalgreediness.Heclaimedtimeandagainthatheheldhimselfinreadinesstothrottlehisbrothera 查看详情

ural1855tradeguildsoferathia

TradeGuildsofErathiaTimelimit:2.0secondMemorylimit:64MBThecontinentofAntagarichwascolonizedslowly.LongagoitsnorthernpartwasinhabitedbytheelvesofAvlee.Later,thehotsoutherndesertofBracadawasoccupiedbyth 查看详情

ural2016magicandscience

2016.MagicandScienceTimelimit:1.0secondMemorylimit:64MBScientistswhospecializeinwitchcrafthaverecentlydiscoveredanewelementaryparticlecalledamagion.Studyingthelawsofmagions’movement,agroupofthre 查看详情

ural2021scarilyinteresting!

2021.Scarilyinteresting!Timelimit:1.0secondMemorylimit:64MBThisyearatMonstersUniversityitisdecidedtoarrangeScareGames.AttheGamesallcampusgathersatthestadiumstands,andtheScareprogramstudentsdivideintot 查看详情

[ural1519]formula1

[URAL1519]Formula1试题描述Regardlessofthefact,thatVologdacouldnotgetrightstoholdtheWinterOlympicgamesof20**,itiswell-known,thatthecitywillconductoneoftheFormula1events.Surely,forsuchanimportantthinganewra 查看详情

ural1118.nontrivialnumbers

1118.NontrivialNumbersTimelimit:2.0secondMemorylimit:64MB SpecialistsofSKBKonturhavedevelopedauniquecryptographicalgorithmforneedsofinformationprotectionwhiletransmittingdataovertheInternet.Thema 查看详情

ural2015zhenyamovesfromthedormitory

2015.ZhenyamovesfromthedormitoryTimelimit:1.0secondMemorylimit:64MBAftermovingfromhisparents’placeZhenyahasbeenlivingintheUniversitydormitoryforamonth.However,hegotprettytiredofthecurfewtimeandq 查看详情

ural2017bestofabadlot

2017.BestofabadlotTimelimit:1.0secondMemorylimit:64MBAcruiselinerhasn’tmovedawayfromthelandevenforthreemileswhenitbecameapparentthatsomebodyhasdrownedoneofthestewardsintheswimmingpool.Thecaptain 查看详情

msa2040默认登录地址/用户名密码

MSA2040默认登录地址/用户名密码IP:10.0.0.2/10.0.0.3用户名:manage密码:!manage 查看详情

ural2012aboutgrishan.

2012.AboutGrishaN.Timelimit:1.0secondMemorylimit:64MBGrishaN.toldhistwoteammatesthathewasgoingtosolveallgivenproblemsatthesubregionalcontest,eveniftheteammateswouldn’tshowupatthecompetition.Thet 查看详情

ural2014zhenyamovesfromparents

2014.ZhenyamovesfromparentsTimelimit:1.0secondMemorylimit:64MBZhenyamovedfromhisparents’hometostudyinothercity.Hedidn’ttakeanycashwithhim,heonlytookhisfather’screditcardwithzerobalan 查看详情