正文
增加 593 行删除 593 行
12345678910111213141516171819202122232425159 行未改动全部展开18518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123241 行未改动2742752762772782792802812822832842852862877 行未改动29529629729829930030130230330430530630730830931031131231331431531631731831957 行未改动37737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144297 行未改动54054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757835 行未改动61461561661761861962062162262362462562662762862963063163263363463517 行未改动65365465565665765865966066166232 行未改动69569669769869970070170270370470570670770870971071171271371471571671771871972072172272372452 行未改动77777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181237 行未改动85085185285385485585685785885986086186286386486586686777 行未改动945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100971 行未改动108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116114 行未改动全部展开123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112622 行未改动126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131040 行未改动1351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148745 行未改动153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160211 行未改动161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016 行未改动169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765(从2025.11.28始记录)#### 1.[青蛙图 (frog)](https://oj.hailiangedu.com/d/pnoi/p/3820?tid=692535b27faa0083b8a821c1)::::info[代码]```#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)#define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))int ahhhhhhhhh,T,n,m,k;159 行未改动全部展开dfs2(1,0);int ans=0;// cout<<1ll*1145141*1145141%mod<<endl;for(int i=1;i<=n;i++){// cout<<dep[i]<<endl;ans=(dep[i]+ans)%mod;}// cout<<endl;cout<<ans<<endl;// cout<<endl<<"=========="<<endl;}return 0;}```::::这题我真是求了,虽然好想,但是小细节调了很久/kel包括但不限于一些唐点:1. 访问vector空节点导致$\color{purple}{RE}$(唐了两次);2. 输入未完成判断后提前```continue```导致多测数据爆炸;(啊对当时本地$\color{purple}{RE}$,OJ上$\color{darkblue}{MLE}$+$\color{darkblue}{TLE}$+$\color{red}{WA}$,给我吓哭了,改完之后就过了)3. 快速幂乘爆int导致$\color{red}{WA}$;4. 算连通块大小时不更新vis导致跑过之后还跑5. 让1与自己所在的连通块连边(当时我还在想为什么明明```k=0```会有边权为```-1```的边)好吧大概也就这些了(~~骗你的,其实是只能想到这些~~),总之就是糖完#### 2.[拆分(div)](https://oj.hailiangedu.com/d/pnoi/p/C25246?tid=692535b27faa0083b8a821c1)::::info[代码]```//f[i][j]:用2^0~2^j拼n的前i位的方案数#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)#define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))int f[210][210],dp[210][210],a[210];41 行未改动ans=(ans+dp[z][i])%mod;}cout<<ans<<endl;}return 0;}```::::这题的话,虽然没耗我很久的debug时间,但是还是很唐就是在58行处`dp[i][j]=(dp[i][j]+dp[i-1][k]*f[a[i]-k][j-k]%mod)%mod;`7 行未改动(~~没错,就是这么唐~~),然后挂了,输出5个0,调的时候差点被唐死/kel#### 3.[CF1290C Prefix Enlightenment](https://codeforces.com/problemset/problem/1290/C)::::info[代码]```cpp#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define mem2(x) memset(x,inf,sizeof(x))57 行未改动}else{cout<<(ans>>1)<<endl;}}return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::这题写的时候没注意,在29行时`return fa[x]=find(fa[x]);`一开始没有加`return`导致$\color{purple}{RE}$~~还好我花两分钟就调出来了(根本不应该有这种错误吧)~~#### 4.[CF1444C Team-Building](https://codeforces.com/problemset/problem/1444/C)::::info[代码]```#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define mem2(x) memset(x,inf,sizeof(x))97 行未改动merge(t.u,t.v+n);merge(t.v,t.u+n);}cout<<ans<<endl;return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::~~哎,第一次写可撤销并查集,写挂了~~42行处`stk[++top]={fx,fy,fa[fx],siz[fx]};35 行未改动}void fphi(int n){phi[1]=1,prime[1]=0,mu[1]=1;for(int i=2;i<=n;i++){if(!vis[i]){prime[++prime[0]]=i;phi[i]=i-1;mu[i]=-1;}for(int j=1;j<=prime[0]&&i*prime[j]<=n;j++){vis[i*prime[j]]=1;if(i%prime[j]==0){phi[i*prime[j]]=phi[i]*prime[j];break;}phi[i*prime[j]]=phi[i]*(prime[j]-1);mu[i*prime[j]]=-mu[i];}}for(int i=1;i<=n;i++){invphi[i]=qpow(phi[i],mod-2,mod);}17 行未改动t[j][k][i]=(t[j][k][i-1]+f[i]*g[i][j]%mod*g[i][k]%mod)%mod;}}}return;}int solve(int n,int m){int res=0;for(int i=1;i<=m/thre;i++){res=(res+f[i]*g[i][n/i]%mod*g[i][m/i]%mod)%mod;32 行未改动`mu[1]=1;`导致`mu`数组初始化错误(好在也没调多久,顺便人生中第二道黑祭)#### 6.[P6328 我是仙人掌](https://www.luogu.com.cn/problem/P6328)::::info[代码]```#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)//#define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 1006#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define mem2(x) memset(x,inf,sizeof(x))52 行未改动ans|=f[x][y];}cout<<ans.count()<<endl;}return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::这题因为11行37 行未改动if(i<fan[i]){swap(f[i],f[fan[i]]);}}for(int ll=2;ll<=l;ll<<=1){//枚举长度int len=ll>>1;//合并长度int w=qpow(fla==1?gen:nigen,(mod-1)/(long long)ll,mod);for(int sta=0;sta<l;sta+=ll){//枚举起点int bas=1;for(int i=sta;i<sta+len;i++){//合并int te=f[i],temp=bas*f[i+len]%mod;f[i]=(te+temp)%mod;f[i+len]=(te-temp+mod)%mod;bas=bas*w%mod;}}}if(fla==-1){77 行未改动cout<<0;}cout<<endl;return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::这题正解是$\color{#2949b4}{压位加速FFT/NTT}$,而又因为题目中没有模数,所以当时以为用模数会挂,结果发现并不会,然后在43行处NTT处理的时候忘记把删掉的$ \% mod$加回去了(如下。`bas=bas*w%mod;`#### 8.[P1491 集合位置](https://www.luogu.com.cn/problem/P1491)::::info[代码]```#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define mem2(x) memset(x,inf,sizeof(x))71 行未改动cout<<-1<<endl;}else{printf("%.2lf\n",ans);}return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::这题用邻接矩阵存图(相对于本题来说较方便~~绝对不是我想用~~),遍历时没有判那个点是否有值(是否接了边)导致样例2始终挂(用0更新答案了)114 行未改动全部展开return 0;}```::::经典树读入了 $n$ 条边(还挂了两次,纠结于为什么 $#8$ 过不去~~虽说找出来同样重要的两个问题,但是丢人~~)饭堂记录:~~依旧CF特有的0分$L\color{red}{GM}$很难绷~~#### 10.[P4926 [1007] 倍杀测量者](https://www.luogu.com.cn/problem/P4926)::::info[代码]```cpp#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define memmax(x) memset(x,0x3f,sizeof(x))2 行未改动const int N=1010;double min(double a,double b){return a<b?a:b;}struct node{int x;double w;};vector<node> v[N];double dis[N];int cnt[N],n,m,t,op[N],a[N],b[N],k[N],xxx[N],yyy[N];bool vis[N];bool spfa(int s){queue<int> q;q.push(s);for(int i=0;i<=n;i++){dis[i]=-inf;}mem(vis);mem(cnt);dis[s]=0;vis[s]=1;while(!q.empty()){int t=q.front();q.pop();vis[t]=0;for(auto i:v[t]){if(dis[i.x]<dis[t]+i.w){dis[i.x]=dis[t]+i.w;cnt[i.x]=cnt[t]+1;if(cnt[i.x]>=n+2){return 0;}if(!vis[i.x]){q.push(i.x);vis[i.x]=1;}}}}return 1;}bool check(double x){for(int i=0;i<=n+1;i++){v[i].clear();}40 行未改动r=mid;}}printf("%.8lf",ans);return 0;}//Ciallo~(∠・ω< )⌒☆/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.誠(まこと)、意地(いじ)の悪(わる)い神(かみ)の所業(しょぎょう)か?奇跡(きせき)?縁(えにし)? 袂(たもと)触合(ふれあ)う不思議(ふしぎ)花(はな)ひとひら揺(ゆ)れて不意(ふい)に宿(やど)ってたうなじ解(ほど)いてく春風(はるかぜ)戯(たわむ)れはそこそこに恋手(こいて)ほどきしてくだしゃんせ湯気(ゆげ)にほんのり頬染(ほほそめ)て夜風(よかぜ)に願ふ(ねがう)いざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょうあやなしココロの穢(けが)れ故(ゆえ)!! 刀(とう)となり 楯(たて)となりてこの想ひ(おもい)護(まも)り賜(たま)え君(きみ)が恋(こい)の門(もん)を殺(あや)めた恋(こい)の罠(わな)は密(ひそ)やかに仕掛(しか)けなきゃ次(つぎ)の一手(いって) すけすけだから困(こま)る鍛錬(たんれん)じゃどうにもなんない揺(ゆ)れる心(こころ)模様(もよう)どっちが先(さき)だ?恋(こい)煩ひ(わずらい)覚悟(かくご)してとおりゃんせ夜道(よみち)と乙女(おとめ)にご用心(ようじん)湯気(ゆげ)の香(かお)り漂(ただよ)わせ 誘(いざな)う夜宴(やえん)しどけなく誘(さそ)いましょ?憑(つ)きませ 偲(しの)ぶ恋夢(こひゆめ)故(ゆえ)! 静(せい)となり 動(どう)となりて我(われ)を導(みちび)き賜(たま)え君(きみ)の剣(けん)がはぁとを射抜(いぬ)いたいざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょう前世(ぜんせい)から繋(つな)がる運命(さだめ)この愛(あい) 護(まも)り賜(たま)え君(きみ)はもう縁(えにし)に選(えら)ばれた*/```::::两个问题:1. 在`72`与`74`行处使用了`log2()`而非`log()`导致对数不一样;2. 在`92`行处应该需要判`op==1`才可以更新`r`。#### 11.[P5590 赛车游戏](https://www.luogu.com.cn/problem/P5590)::::info[代码]```cpp#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define memmax(x) memset(x,0x3f,sizeof(x))#define memmin(x) memset(x,-0x3f,sizeof(x))const int N=2010;struct node{int x,w;};vector<node> v[N];vector<int> g[N],fang[N];int dis[N],cnt[N],n,m,x[N],y[N];bool vis[N],f,visg[N],visfang[N],can[N];void spfa(int s){queue<int> q;q.push(s);memmax(dis);mem(vis);mem(cnt);dis[s]=0;vis[s]=1;f=1;while(!q.empty()){int t=q.front();q.pop();vis[t]=0;for(auto i:v[t]){if(dis[i.x]>dis[t]+i.w){dis[i.x]=dis[t]+i.w;cnt[i.x]++;if(cnt[i.x]>=n){f=0;return;}if(!vis[i.x]){q.push(i.x);vis[i.x]=1;}}}}}void dfs(int x){visg[x]=1;for(auto i:g[x]){if(!visg[i]){45 行未改动cout<<x[i]<<" "<<y[i]<<" "<<1<<endl;}}}return 0;}//Ciallo~(∠・ω< )⌒☆/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.誠(まこと)、意地(いじ)の悪(わる)い神(かみ)の所業(しょぎょう)か?奇跡(きせき)?縁(えにし)? 袂(たもと)触合(ふれあ)う不思議(ふしぎ)花(はな)ひとひら揺(ゆ)れて不意(ふい)に宿(やど)ってたうなじ解(ほど)いてく春風(はるかぜ)戯(たわむ)れはそこそこに恋手(こいて)ほどきしてくだしゃんせ湯気(ゆげ)にほんのり頬染(ほほそめ)て夜風(よかぜ)に願ふ(ねがう)いざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょうあやなしココロの穢(けが)れ故(ゆえ)!! 刀(とう)となり 楯(たて)となりてこの想ひ(おもい)護(まも)り賜(たま)え君(きみ)が恋(こい)の門(もん)を殺(あや)めた恋(こい)の罠(わな)は密(ひそ)やかに仕掛(しか)けなきゃ次(つぎ)の一手(いって) すけすけだから困(こま)る鍛錬(たんれん)じゃどうにもなんない揺(ゆ)れる心(こころ)模様(もよう)どっちが先(さき)だ?恋(こい)煩ひ(わずらい)覚悟(かくご)してとおりゃんせ夜道(よみち)と乙女(おとめ)にご用心(ようじん)湯気(ゆげ)の香(かお)り漂(ただよ)わせ 誘(いざな)う夜宴(やえん)しどけなく誘(さそ)いましょ?憑(つ)きませ 偲(しの)ぶ恋夢(こひゆめ)故(ゆえ)! 静(せい)となり 動(どう)となりて我(われ)を導(みちび)き賜(たま)え君(きみ)の剣(けん)がはぁとを射抜(いぬ)いたいざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょう前世(ぜんせい)から繋(つな)がる運命(さだめ)この愛(あい) 護(まも)り賜(たま)え君(きみ)はもう縁(えにし)に選(えら)ばれた*/```::::这题要判负环,然后我写成了路径上的经过次数,导致原本的`54`行11 行未改动#### 12.[P4578 [FJOI2018] 所罗门王的宝藏](https://www.luogu.com.cn/problem/P4578)::::info[代码]```cpp#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)#define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define memmax(x) memset(x,0x3f,sizeof(x))#define memmin(x) memset(x,-0x3f,sizeof(x))const int N=2010;struct node{int x,w;};vector<node> v[N];int dis[N],cnt[N],n,m,k;bool vis[N],f;void spfa(int s){queue<int> q;q.push(s);memmax(dis);mem(vis);mem(cnt);dis[s]=0;vis[s]=1;f=1;while(!q.empty()){int t=q.front();q.pop();vis[t]=0;for(auto i:v[t]){if(dis[i.x]>dis[t]+i.w){dis[i.x]=dis[t]+i.w;// cnt[i.x]=cnt[t]+1;cnt[i.x]++;if(cnt[i.x]>=n+m+1){f=0;return;}if(!vis[i.x]){q.push(i.x);vis[i.x]=1;}}}}}signed main(){int T;cin>>T;while(T--){16 行未改动for(int i=1;i<=n+m+1;i++){v[i].clear();}}return 0;}//Ciallo~(∠・ω< )⌒☆/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.誠(まこと)、意地(いじ)の悪(わる)い神(かみ)の所業(しょぎょう)か?奇跡(きせき)?縁(えにし)? 袂(たもと)触合(ふれあ)う不思議(ふしぎ)花(はな)ひとひら揺(ゆ)れて不意(ふい)に宿(やど)ってたうなじ解(ほど)いてく春風(はるかぜ)戯(たわむ)れはそこそこに恋手(こいて)ほどきしてくだしゃんせ湯気(ゆげ)にほんのり頬染(ほほそめ)て夜風(よかぜ)に願ふ(ねがう)いざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょうあやなしココロの穢(けが)れ故(ゆえ)!! 刀(とう)となり 楯(たて)となりてこの想ひ(おもい)護(まも)り賜(たま)え君(きみ)が恋(こい)の門(もん)を殺(あや)めた恋(こい)の罠(わな)は密(ひそ)やかに仕掛(しか)けなきゃ次(つぎ)の一手(いって) すけすけだから困(こま)る鍛錬(たんれん)じゃどうにもなんない揺(ゆ)れる心(こころ)模様(もよう)どっちが先(さき)だ?恋(こい)煩ひ(わずらい)覚悟(かくご)してとおりゃんせ夜道(よみち)と乙女(おとめ)にご用心(ようじん)湯気(ゆげ)の香(かお)り漂(ただよ)わせ 誘(いざな)う夜宴(やえん)しどけなく誘(さそ)いましょ?憑(つ)きませ 偲(しの)ぶ恋夢(こひゆめ)故(ゆえ)! 静(せい)となり 動(どう)となりて我(われ)を導(みちび)き賜(たま)え君(きみ)の剣(けん)がはぁとを射抜(いぬ)いたいざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょう前世(ぜんせい)から繋(つな)がる運命(さだめ)この愛(あい) 護(まも)り賜(たま)え君(きみ)はもう縁(えにし)に選(えら)ばれた*/```::::~~这题在判负环时(依旧负环)时写成`n+m`而不是`n+m+1`了~~12345678910111213141516171819202122232425159 行未改动全部展开18518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123241 行未改动2742752762772782792802812822832842852862877 行未改动29529629729829930030130230330430530630730830931031131231331431531631731831957 行未改动37737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144297 行未改动54054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757835 行未改动61461561661761861962062162262362462562662762862963063163263363463517 行未改动65365465565665765865966066166232 行未改动69569669769869970070170270370470570670770870971071171271371471571671771871972072172272372452 行未改动77777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181237 行未改动85085185285385485585685785885986086186286386486586686777 行未改动945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100971 行未改动108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116114 行未改动全部展开123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112622 行未改动126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131040 行未改动1351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148745 行未改动153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160211 行未改动161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016 行未改动169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765(从2025.11.28始记录)#### 1.[青蛙图 (frog)](https://oj.hailiangedu.com/d/pnoi/p/3820?tid=692535b27faa0083b8a821c1)::::info[代码]```#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)#define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))int ahhhhhhhhh,T,n,m,k;159 行未改动全部展开dfs2(1,0);int ans=0;// cout<<1ll*1145141*1145141%mod<<endl;for(int i=1;i<=n;i++){// cout<<dep[i]<<endl;ans=(dep[i]+ans)%mod;}// cout<<endl;cout<<ans<<endl;// cout<<endl<<"=========="<<endl;}return 0;}```::::这题我真是求了,虽然好想,但是小细节调了很久/kel包括但不限于一些唐点:1. 访问vector空节点导致$\color{purple}{RE}$(唐了两次);2. 输入未完成判断后提前```continue```导致多测数据爆炸;(啊对当时本地$\color{purple}{RE}$,OJ上$\color{darkblue}{MLE}$+$\color{darkblue}{TLE}$+$\color{red}{WA}$,给我吓哭了,改完之后就过了)3. 快速幂乘爆int导致$\color{red}{WA}$;4. 算连通块大小时不更新vis导致跑过之后还跑5. 让1与自己所在的连通块连边(当时我还在想为什么明明```k=0```会有边权为```-1```的边)好吧大概也就这些了(~~骗你的,其实是只能想到这些~~),总之就是糖完#### 2.[拆分(div)](https://oj.hailiangedu.com/d/pnoi/p/C25246?tid=692535b27faa0083b8a821c1)::::info[代码]```//f[i][j]:用2^0~2^j拼n的前i位的方案数#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)#define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))int f[210][210],dp[210][210],a[210];41 行未改动ans=(ans+dp[z][i])%mod;}cout<<ans<<endl;}return 0;}```::::这题的话,虽然没耗我很久的debug时间,但是还是很唐就是在58行处`dp[i][j]=(dp[i][j]+dp[i-1][k]*f[a[i]-k][j-k]%mod)%mod;`7 行未改动(~~没错,就是这么唐~~),然后挂了,输出5个0,调的时候差点被唐死/kel#### 3.[CF1290C Prefix Enlightenment](https://codeforces.com/problemset/problem/1290/C)::::info[代码]```cpp#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define mem2(x) memset(x,inf,sizeof(x))57 行未改动}else{cout<<(ans>>1)<<endl;}}return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::这题写的时候没注意,在29行时`return fa[x]=find(fa[x]);`一开始没有加`return`导致$\color{purple}{RE}$~~还好我花两分钟就调出来了(根本不应该有这种错误吧)~~#### 4.[CF1444C Team-Building](https://codeforces.com/problemset/problem/1444/C)::::info[代码]```#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define mem2(x) memset(x,inf,sizeof(x))97 行未改动merge(t.u,t.v+n);merge(t.v,t.u+n);}cout<<ans<<endl;return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::~~哎,第一次写可撤销并查集,写挂了~~42行处`stk[++top]={fx,fy,fa[fx],siz[fx]};35 行未改动}void fphi(int n){phi[1]=1,prime[1]=0,mu[1]=1;for(int i=2;i<=n;i++){if(!vis[i]){prime[++prime[0]]=i;phi[i]=i-1;mu[i]=-1;}for(int j=1;j<=prime[0]&&i*prime[j]<=n;j++){vis[i*prime[j]]=1;if(i%prime[j]==0){phi[i*prime[j]]=phi[i]*prime[j];break;}phi[i*prime[j]]=phi[i]*(prime[j]-1);mu[i*prime[j]]=-mu[i];}}for(int i=1;i<=n;i++){invphi[i]=qpow(phi[i],mod-2,mod);}17 行未改动t[j][k][i]=(t[j][k][i-1]+f[i]*g[i][j]%mod*g[i][k]%mod)%mod;}}}return;}int solve(int n,int m){int res=0;for(int i=1;i<=m/thre;i++){res=(res+f[i]*g[i][n/i]%mod*g[i][m/i]%mod)%mod;32 行未改动`mu[1]=1;`导致`mu`数组初始化错误(好在也没调多久,顺便人生中第二道黑祭)#### 6.[P6328 我是仙人掌](https://www.luogu.com.cn/problem/P6328)::::info[代码]```#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)//#define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 1006#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define mem2(x) memset(x,inf,sizeof(x))52 行未改动ans|=f[x][y];}cout<<ans.count()<<endl;}return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::这题因为11行37 行未改动if(i<fan[i]){swap(f[i],f[fan[i]]);}}for(int ll=2;ll<=l;ll<<=1){//枚举长度int len=ll>>1;//合并长度int w=qpow(fla==1?gen:nigen,(mod-1)/(long long)ll,mod);for(int sta=0;sta<l;sta+=ll){//枚举起点int bas=1;for(int i=sta;i<sta+len;i++){//合并int te=f[i],temp=bas*f[i+len]%mod;f[i]=(te+temp)%mod;f[i+len]=(te-temp+mod)%mod;bas=bas*w%mod;}}}if(fla==-1){77 行未改动cout<<0;}cout<<endl;return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::这题正解是$\color{#2949b4}{压位加速FFT/NTT}$,而又因为题目中没有模数,所以当时以为用模数会挂,结果发现并不会,然后在43行处NTT处理的时候忘记把删掉的$ \% mod$加回去了(如下。`bas=bas*w%mod;`#### 8.[P1491 集合位置](https://www.luogu.com.cn/problem/P1491)::::info[代码]```#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define mem2(x) memset(x,inf,sizeof(x))71 行未改动cout<<-1<<endl;}else{printf("%.2lf\n",ans);}return 0;}/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.*/```::::这题用邻接矩阵存图(相对于本题来说较方便~~绝对不是我想用~~),遍历时没有判那个点是否有值(是否接了边)导致样例2始终挂(用0更新答案了)114 行未改动全部展开return 0;}```::::经典树读入了 $n$ 条边(还挂了两次,纠结于为什么 $#8$ 过不去~~虽说找出来同样重要的两个问题,但是丢人~~)饭堂记录:~~依旧CF特有的0分$L\color{red}{GM}$很难绷~~#### 10.[P4926 [1007] 倍杀测量者](https://www.luogu.com.cn/problem/P4926)::::info[代码]```cpp#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define memmax(x) memset(x,0x3f,sizeof(x))2 行未改动const int N=1010;double min(double a,double b){return a<b?a:b;}struct node{int x;double w;};vector<node> v[N];double dis[N];int cnt[N],n,m,t,op[N],a[N],b[N],k[N],xxx[N],yyy[N];bool vis[N];bool spfa(int s){queue<int> q;q.push(s);for(int i=0;i<=n;i++){dis[i]=-inf;}mem(vis);mem(cnt);dis[s]=0;vis[s]=1;while(!q.empty()){int t=q.front();q.pop();vis[t]=0;for(auto i:v[t]){if(dis[i.x]<dis[t]+i.w){dis[i.x]=dis[t]+i.w;cnt[i.x]=cnt[t]+1;if(cnt[i.x]>=n+2){return 0;}if(!vis[i.x]){q.push(i.x);vis[i.x]=1;}}}}return 1;}bool check(double x){for(int i=0;i<=n+1;i++){v[i].clear();}40 行未改动r=mid;}}printf("%.8lf",ans);return 0;}//Ciallo~(∠・ω< )⌒☆/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.誠(まこと)、意地(いじ)の悪(わる)い神(かみ)の所業(しょぎょう)か?奇跡(きせき)?縁(えにし)? 袂(たもと)触合(ふれあ)う不思議(ふしぎ)花(はな)ひとひら揺(ゆ)れて不意(ふい)に宿(やど)ってたうなじ解(ほど)いてく春風(はるかぜ)戯(たわむ)れはそこそこに恋手(こいて)ほどきしてくだしゃんせ湯気(ゆげ)にほんのり頬染(ほほそめ)て夜風(よかぜ)に願ふ(ねがう)いざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょうあやなしココロの穢(けが)れ故(ゆえ)!! 刀(とう)となり 楯(たて)となりてこの想ひ(おもい)護(まも)り賜(たま)え君(きみ)が恋(こい)の門(もん)を殺(あや)めた恋(こい)の罠(わな)は密(ひそ)やかに仕掛(しか)けなきゃ次(つぎ)の一手(いって) すけすけだから困(こま)る鍛錬(たんれん)じゃどうにもなんない揺(ゆ)れる心(こころ)模様(もよう)どっちが先(さき)だ?恋(こい)煩ひ(わずらい)覚悟(かくご)してとおりゃんせ夜道(よみち)と乙女(おとめ)にご用心(ようじん)湯気(ゆげ)の香(かお)り漂(ただよ)わせ 誘(いざな)う夜宴(やえん)しどけなく誘(さそ)いましょ?憑(つ)きませ 偲(しの)ぶ恋夢(こひゆめ)故(ゆえ)! 静(せい)となり 動(どう)となりて我(われ)を導(みちび)き賜(たま)え君(きみ)の剣(けん)がはぁとを射抜(いぬ)いたいざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょう前世(ぜんせい)から繋(つな)がる運命(さだめ)この愛(あい) 護(まも)り賜(たま)え君(きみ)はもう縁(えにし)に選(えら)ばれた*/```::::两个问题:1. 在`72`与`74`行处使用了`log2()`而非`log()`导致对数不一样;2. 在`92`行处应该需要判`op==1`才可以更新`r`。#### 11.[P5590 赛车游戏](https://www.luogu.com.cn/problem/P5590)::::info[代码]```cpp#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)// #define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define memmax(x) memset(x,0x3f,sizeof(x))#define memmin(x) memset(x,-0x3f,sizeof(x))const int N=2010;struct node{int x,w;};vector<node> v[N];vector<int> g[N],fang[N];int dis[N],cnt[N],n,m,x[N],y[N];bool vis[N],f,visg[N],visfang[N],can[N];void spfa(int s){queue<int> q;q.push(s);memmax(dis);mem(vis);mem(cnt);dis[s]=0;vis[s]=1;f=1;while(!q.empty()){int t=q.front();q.pop();vis[t]=0;for(auto i:v[t]){if(dis[i.x]>dis[t]+i.w){dis[i.x]=dis[t]+i.w;cnt[i.x]++;if(cnt[i.x]>=n){f=0;return;}if(!vis[i.x]){q.push(i.x);vis[i.x]=1;}}}}}void dfs(int x){visg[x]=1;for(auto i:g[x]){if(!visg[i]){45 行未改动cout<<x[i]<<" "<<y[i]<<" "<<1<<endl;}}}return 0;}//Ciallo~(∠・ω< )⌒☆/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.誠(まこと)、意地(いじ)の悪(わる)い神(かみ)の所業(しょぎょう)か?奇跡(きせき)?縁(えにし)? 袂(たもと)触合(ふれあ)う不思議(ふしぎ)花(はな)ひとひら揺(ゆ)れて不意(ふい)に宿(やど)ってたうなじ解(ほど)いてく春風(はるかぜ)戯(たわむ)れはそこそこに恋手(こいて)ほどきしてくだしゃんせ湯気(ゆげ)にほんのり頬染(ほほそめ)て夜風(よかぜ)に願ふ(ねがう)いざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょうあやなしココロの穢(けが)れ故(ゆえ)!! 刀(とう)となり 楯(たて)となりてこの想ひ(おもい)護(まも)り賜(たま)え君(きみ)が恋(こい)の門(もん)を殺(あや)めた恋(こい)の罠(わな)は密(ひそ)やかに仕掛(しか)けなきゃ次(つぎ)の一手(いって) すけすけだから困(こま)る鍛錬(たんれん)じゃどうにもなんない揺(ゆ)れる心(こころ)模様(もよう)どっちが先(さき)だ?恋(こい)煩ひ(わずらい)覚悟(かくご)してとおりゃんせ夜道(よみち)と乙女(おとめ)にご用心(ようじん)湯気(ゆげ)の香(かお)り漂(ただよ)わせ 誘(いざな)う夜宴(やえん)しどけなく誘(さそ)いましょ?憑(つ)きませ 偲(しの)ぶ恋夢(こひゆめ)故(ゆえ)! 静(せい)となり 動(どう)となりて我(われ)を導(みちび)き賜(たま)え君(きみ)の剣(けん)がはぁとを射抜(いぬ)いたいざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょう前世(ぜんせい)から繋(つな)がる運命(さだめ)この愛(あい) 護(まも)り賜(たま)え君(きみ)はもう縁(えにし)に選(えら)ばれた*/```::::这题要判负环,然后我写成了路径上的经过次数,导致原本的`54`行11 行未改动#### 12.[P4578 [FJOI2018] 所罗门王的宝藏](https://www.luogu.com.cn/problem/P4578)::::info[代码]```cpp#include<bits/stdc++.h>using namespace std;//#pragma GCC optimize(2)#define int long long#define endl "\n"#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);#define file(x) freopen(x+".in","r",stdin); freopen(x+".out","w",stdout);#define pb emplace_back#define fi first#define se second#define inf 2e9#define pii pair<int,int>#define vi vector<int>#define all(x) x.begin(),x.end()#define mii map<int,int>#define pq priority_queue<int>#define pqi priority_queue<int,vi,greater<int>>#define abs(a) (a>0? a:-a)#define pi acos(-1)#define mem(x) memset(x,0,sizeof(x))#define memmax(x) memset(x,0x3f,sizeof(x))#define memmin(x) memset(x,-0x3f,sizeof(x))const int N=2010;struct node{int x,w;};vector<node> v[N];int dis[N],cnt[N],n,m,k;bool vis[N],f;void spfa(int s){queue<int> q;q.push(s);memmax(dis);mem(vis);mem(cnt);dis[s]=0;vis[s]=1;f=1;while(!q.empty()){int t=q.front();q.pop();vis[t]=0;for(auto i:v[t]){if(dis[i.x]>dis[t]+i.w){dis[i.x]=dis[t]+i.w;// cnt[i.x]=cnt[t]+1;cnt[i.x]++;if(cnt[i.x]>=n+m+1){f=0;return;}if(!vis[i.x]){q.push(i.x);vis[i.x]=1;}}}}}signed main(){int T;cin>>T;while(T--){16 行未改动for(int i=1;i<=n+m+1;i++){v[i].clear();}}return 0;}//Ciallo~(∠・ω< )⌒☆/*Darkest night, I'll confront you here. ...Such a destiny was not desired.In this place, I never wished to see that side of you.And raise different colors for one another.Never notice me.Never call my name with your voice.Let me forget everything and leave no trace of you.What am I carrying out in this horizon of despair?If it's not you, I can hurt anyone in the name of justice.Your shadow gets in the way of my light.And testify. ...Let me forget everything, still moonlight shines on us.Broken heart, I don't want you to find and take a look at.So I'll sin more and destroy my thoughts, make a mess of my hand.I swear on the darkest night I'll end it all.And testify. ...All that I'm left with is your reminiscences.Take me to where you are, won't you?Till then I'll keep struggling.Curse of justice you don't know.誠(まこと)、意地(いじ)の悪(わる)い神(かみ)の所業(しょぎょう)か?奇跡(きせき)?縁(えにし)? 袂(たもと)触合(ふれあ)う不思議(ふしぎ)花(はな)ひとひら揺(ゆ)れて不意(ふい)に宿(やど)ってたうなじ解(ほど)いてく春風(はるかぜ)戯(たわむ)れはそこそこに恋手(こいて)ほどきしてくだしゃんせ湯気(ゆげ)にほんのり頬染(ほほそめ)て夜風(よかぜ)に願ふ(ねがう)いざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょうあやなしココロの穢(けが)れ故(ゆえ)!! 刀(とう)となり 楯(たて)となりてこの想ひ(おもい)護(まも)り賜(たま)え君(きみ)が恋(こい)の門(もん)を殺(あや)めた恋(こい)の罠(わな)は密(ひそ)やかに仕掛(しか)けなきゃ次(つぎ)の一手(いって) すけすけだから困(こま)る鍛錬(たんれん)じゃどうにもなんない揺(ゆ)れる心(こころ)模様(もよう)どっちが先(さき)だ?恋(こい)煩ひ(わずらい)覚悟(かくご)してとおりゃんせ夜道(よみち)と乙女(おとめ)にご用心(ようじん)湯気(ゆげ)の香(かお)り漂(ただよ)わせ 誘(いざな)う夜宴(やえん)しどけなく誘(さそ)いましょ?憑(つ)きませ 偲(しの)ぶ恋夢(こひゆめ)故(ゆえ)! 静(せい)となり 動(どう)となりて我(われ)を導(みちび)き賜(たま)え君(きみ)の剣(けん)がはぁとを射抜(いぬ)いたいざ!! 蝶(ちょう)と舞ひ(まい) 花(はな)となりて衣(きぬ)を乱(みだ)して祓(はら)いましょう前世(ぜんせい)から繋(つな)がる運命(さだめ)この愛(あい) 護(まも)り賜(たま)え君(きみ)はもう縁(えにし)に選(えら)ばれた*/```::::~~这题在判负环时(依旧负环)时写成`n+m`而不是`n+m+1`了~~