版本比较
NOIP2025 FJ代码迷惑行为大赏
正文
增加 203 行删除 203 行
101 行未改动全部展开10210310410510610610710810911011 行未改动12212312412512612612712812913023 行未改动15415515615715815815916016116216316416516616616716816917020 行未改动19119219319419519519619719819920020120220320420520620520620720820921032 行未改动24324424524624724724824925025114 行未改动266267268269270270271272273274102 行未改动全部展开37737837938038138138238338438563 行未改动4494504514524534544534544554564574587 行未改动46646746846947047047147247347447547647747847948048048148248348417 行未改动5025035045055065075085095065075085095105115125135145155135145155165175185197 行未改动52752852953053153153253353453553653753853954054154254354453753853954054154254354454554654754854954654754854955055155255355155255355455555655755855956056056156256356456556656756756856957057157257357457457557657757857958058158258358458458558658758820 行未改动60961061161261361361461561661715 行未改动6336346356366376376386396406416426436446446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896816826836846856866876886896906916926936946956966966976986997005 行未改动7067077087097107117127137147157167107117127137147157167177187197206 行未改动727728729730731732731732733734735736737738739740741742742743744745746238 行未改动全部展开98598698798898998999099199299355 行未改动10491050105110521053105310541055105610571057105810591060106110621063106410651065106610671068106910701070107110721073107410731074107510761076107710781079108010811081108210831084108410851086108710882 行未改动10911092109310941095109510961097109710981099110011012 行未改动11041105110611071108110811091110111111122 行未改动1115111611171118111911191120112111221123118 行未改动全部展开12421243124412451246124612471248124912507 行未改动125812591260126112621262126312641265126512661267126812697 行未改动127712781279128012811281128212831284128511 行未改动12971298129913001301130113021303130313041305130613074 行未改动131213131314131513161316131713181319132018 行未改动133913401341134213431343134413451346134724 行未改动13721373137413751376137613771378137913801380138113821383138425 行未改动1410141114121413141414141415141614171418120 行未改动全部展开153915401541154215431543154415451546154715481549154915501551155115521553155415551556155715581558155915601561156115621563156415641565156615661567156815691569157015711571157215731573157415751576157615771578157815791580158115811582158315841584158515861586158715881588158915901590159115921592159315941595159679 行未改动167616771678167916801680168116821683168428 行未改动1713171417151716171717171718171917201721233 行未改动全部展开195519561957195819591959196019611962196319641965196619671967196819691969197019711972197319741975197619771978197819791980198119821983198419831984198519861987198719881989199019911992199319941995199519961997199819994 行未改动20042005200620072008200820092010201020112012201320142015201620162017201820192019202020212022202220232024202520262027202820292030203020312032203320342035203620372038203820392040204120426 行未改动204920502051205220532053205420552056205620572058205920602 行未改动206320642065206620672067206820692070207120722069207020712072207320742074207520762077207820792078207920802081208220832084208420852086208720872088208920902091209120922093209320942095209620952096209720982099209820992100210121022102210321042105210621062107210821082109211021112112211321142115211621162117211821192120212121222123212421252126212321242125212621272128212921292130213121322133213421352136213621372138213921402141214221432144214521452146214721472148214921492150215121522153215421552156215721572158215921602160216121622163216410 行未改动217521762177217821792179218021812182218321842185218421852186218721872188218921902191219121922193219421952196219721982199219922002201220222032204220522062207220822092209221022112212221322142215221522162217221822194 行未改动2224222522262227222822292228222922302231223122322233223422356 行未改动22422243224422452246224722482246224722482249225022512252225322532254225522562257225822552256225722582259226022602261226222632263226422652266226736 行未改动101 行未改动全部展开#### FJ-0502tree.cpp(好吧还是我高估了 NOIP 选手)```cppfreopen("tree.out","w+",stdout);``` ```
### 神秘注释
#### FJ-001211 行未改动sale.cpp(不会)```cpp//namespace m2{ //buhui
//}
//aeirhguerhgaiojsamdfcoiqhbiu```23 行未改动query.cpp(惊喜)```cpp//如果你看到这里了,那我可以告诉你一个惊喜//爆零了//懒得写了,拜拜。 //懒得写了,拜拜。```sale.cpp(到底是不是 dp 呢)```cpp// seems like DPPDPDPDPDDPDPDPDPDPPPPPDDDDDPPPDDP// doesnt seem like DPPPDPDPDDDPDPDPDPDPPDPPDDDDP//god save me//zhe you shen me dao li a//已严肃:面向数据点编程 //已严肃:面向数据点编程```tree.cpp(是不是呢?)```cpp//shuxing DPDPDPDDPDPDPDPPDPDPDDDDPPPPDPDPDPDPDDP20 行未改动2 33 1
键盘实在太幽默了9:06 9:06
*/```#### FJ-0081
query.cpp(六年老兵)```cpp/*Away From OI(2019.12.28~2025.11.29)以此纪念我生命中一段难忘的旅程 */ 以此纪念我生命中一段难忘的旅程*/```
#### FJ-0083
32 行未改动11:27 got T2 baoli and A 149pts12:06 I couldn't do counting!!!try T3failed149pts AFO..... 149pts AFO.....*/```
#### FJ-010914 行未改动#### FJ-0116query.cpp(对嘛)```cpp也就8分而已,死磕那么久干嘛。最终也是顺利失败了。 最终也是顺利失败了。```
#### FJ-0062
102 行未改动全部展开沉默地站着。但陆衍邦的心里没那么沉默。看着身旁低着头的少女,陆衍邦心里呐喊着:“???天底下真有这么巧的事让我撞上了?感谢老天!”沉默。沉默地走出电梯。 沉默地走出电梯。沉默地同行。沉默地来到早餐摊。“你要吃什么?我请你吧。”陆衍邦从兜里掏出手机。“啊?那怎么好意思呀。”63 行未改动“……不是,我求你了。”“求我的人从这里排到了法国,排队去。”看着手上的2号签,陆衍邦清晰地感觉到自己的耳朵无比的滚烫,血液正不断地往脸上涌去。他叹了口气,像是下定了决心,转过脑袋去。看着眼前同样满脸通红,几乎要冒烟的少女,陆衍邦清了清嗓子:“老黄,事先声明啊,这都是游戏需要,不是真心话嗷,别往心里去。” 陆衍邦深吸了一口气,艰难地说道: 看着眼前同样满脸通红,几乎要冒烟的少女,陆衍邦清了清嗓子:“老黄,事先声明啊,这都是游戏需要,不是真心话嗷,别往心里去。”陆衍邦深吸了一口气,艰难地说道:“我……”“我……”“我……”“我喜……”7 行未改动
#### FJ-0262candy.cpp(为什么啊!)```cpp//为什么呢?为什么结果是错的,样例全跑过去了呢?我实在想不通,但既然样例过了那就不管了,直接交上去了;RP++! //为什么呢?为什么结果是错的,样例全跑过去了呢?我实在想不通,但既然样例过了那就不管了,直接交上去了;RP++!```
#### FJ-0274自行欣赏```cpp//why my T1 6th is 82 not 83?
//ccfwcnm
//i love you //i love you
//i don't love you
//to be or not to be,this is the question17 行未改动//350234
//怎么还有十分钟啊
//河北师大附中 //乒乓少年背向我 //沉默的注视 //无法离开的教室 //河北师大附中//乒乓少年背向我//沉默的注视//无法离开的教室// 生活在经验里// 直到大厦崩塌
//电灯熄灭 //物换星移 //泥牛入海 //电灯熄灭//物换星移//泥牛入海
//钟山风雨起苍黄,百万雄师过大江```
7 行未改动See UNext levelLoog time no see huh又势在必得莫比乌斯闭合 莫比乌斯闭合*/```sale.cpp(还是个大诗人)```cpp/*三十三声 铃声之后是夕阳带黄昏 三十三声 你跟我一样在强撑 三十三声 那年杜苏芮激浪载狂风 三十三声 教室里传唱彼岸花双生 三十三声 你已不在我身畔 校园雨天路灯暗 忧愁何人来分担 唯念白露前枫丹 三十三声 铃声之后是夕阳带黄昏三十三声 你跟我一样在强撑三十三声 那年杜苏芮激浪载狂风三十三声 教室里传唱彼岸花双生三十三声 你已不在我身畔 校园雨天路灯暗 忧愁何人来分担 唯念白露前枫丹
心灵在大雨中跌宕 是你我不可能遗忘 研学我们在台上齐唱 呵 那只是我的臆想 心灵在大雨中跌宕是你我不可能遗忘研学我们在台上齐唱呵 那只是我的臆想
闭上眼睛靠在窗前 因为我没碰过香烟 书包里注定掏不出项链 闭上眼睛靠在窗前因为我没碰过香烟书包里注定掏不出项链*/```tree.cpp(嗯)```cpp/*你一直在我的心里从来不逃避 也不会放弃 从来不逃避 也不会放弃*/
/*钢筋铁骨双臂硬如松沉浸在不败的幸福中心境高雅韵如风Call me 英俊潇洒令狐冲 Call me 英俊潇洒令狐冲*/```
#### FJ-0311candy.cpp(祝你幸福哦)```cpp//表白xwsf K二6LJL //表白xwsf K二6LJL```#### FJ-0314sale.cpp(我也这样认为)```cpp//CCF has no egg//今年和糖果杠上了是吧```tree.cpp(?)```cpp//我命由天不由我 //我命由天不由我```
#### FJ-0326query.cpp(路灯)20 行未改动//greedy special AB//onegai, 1 kara 5 made no tesuto pointo wo paasu suru.//TAT TAT TAT TAT TAT TAT TAT TAT TAT TAT//tasukete!tasukete!tasukete!tasukete!tasukete!tasukete!tasukete!//watasiha, tyougoku no jyouhou gakukai ga dai suki nanode, paasu site onegai... //watasiha, tyougoku no jyouhou gakukai ga dai suki nanode, paasu site onegai...```query.cpp(最后的表白)```cpp//I love you forever.15 行未改动
#### FJ-0379query.cpp(很惨了)```cpp// Why there is no 64-bit compiler?????? // Why there is no 64-bit compiler??????```
#### FJ-0406tree.cpp(十年 OI 一场空)```cpp// Ten years' OI is out of use,// when you don't use ll to visit ancestors. // when you don't use ll to visit ancestors.```
#### FJ-0411膜谁呢这是?```cpp//orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz //orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz//orz```
#### FJ-0416candy.cpp(画画大师)```cpp/*???????? ???????? ???????? ????? ???????? ???????? ???????? ????? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???????? ???????? ???????? ?? ???????? ???????? ???????? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???????? ???????? ???????? ????????????? ???????? ???????? ??????? ?? ?? ?? ?? ???? ?? ?? ?? ?? ?????????? ???????? ???????? ?????????? ???????? ???????? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???????? ????????*/```sale.cpp(十分形象)```cpp/*
[ ]--==Sakuzyo Beam==>>>> | |\
5 行未改动tree.cpp(给 ccf 的信)```cpp/*To CCF_NOI:我看着 零落的 枯的 碎的 风肆意地 卷起那 满地的皱褶 像我们的纠葛 腐烂成沼泽 痛快地 飞舞着 飘着 烧着 无休止地 恨不得 要一整个透彻 多苦涩 像刀割 被拉扯ToT 循着—— 看不见 听不见 一转眼 搁浅 太危险 再蔓延 我无力深陷 看不见 听不见 一转眼 搁浅 太危险 再蔓延 循着你画的线 我看着 零落的 枯的 碎的 风肆意地 卷起那 满地的皱褶像我们的纠葛 腐烂成沼泽痛快地 飞舞着 飘着 烧着 无休止地 恨不得 要一整个透彻多苦涩 像刀割 被拉扯ToT循着——看不见 听不见 一转眼 搁浅 太危险 再蔓延 我无力深陷看不见 听不见 一转眼 搁浅 太危险 再蔓延 循着你画的线I LOVE CCF_NOI FOR EVER!!!*/```
6 行未改动BaoLi is very good can solve candy1-6BaoLi I love you!!!9:41OHHHHHHHHHH I AC candy7maybe I AC T1 */ maybe I AC T1*/```
#### FJ-0429query.cpp(差点把你漏了)```cpp#include <bits/stdc++.h>using namespace std;
int main(){
return 0;}
238 行未改动全部展开 cout<<pow[n]<<endl; } } return 0;} }```#### FJ-0166sale.cpp(压行事故多发地,从 "long long" 到 "int" 进行收缩转换无效:long long R())```cpp55 行未改动
int solve(int len){ int res = 0; int sum = 0;
for(int i = 1; i <= len; i++){ sum += a[i]; }
res = max(res, sum); for(int l = 2; l + len - 1 <= n; l++){ int r = l + len - 1; sum -= a[i]; sum += a[r]; res = max(res, sum); }
return res;}
signed main(){
//ios::sync_with_stdio(0); //cin.tie(0); freopen("query.in", "r", stdin);
freopen("query.in", "r", stdin); freopen("query.out", "w", stdout);
cin>> n; for(int i = 1; i <= n; i++){ cin>> a[i]; }
int q; cin>> q;
int ans = 0; for(int i = 1; i <= q; i++){ int L, R; cin>> L >> R;2 行未改动 ans = max(ans, solve(j)); } cout<< ans << "\n"; }
return 0;} }```
#### FJ-0184tree.cpp(如你所愿,找不到用户定义的文本运算符,字符 U+ff1b ";" 可能会与 ASCII 字符 U+003b ";" 混淆,后者在源代码中更为常见。)2 行未改动using namespace std;int t;int n,m;vector<int>v[8005];//希望能上奇葩代码 //希望能上奇葩代码int main(){ freopen("tree.in","r",stdin); freopen("tree.out","w",stdout); cin>>t;2 行未改动 for(int i=1,x;i<=n;i++){ cin>>x; v[x].push_back(i); } cout<<"不会了,太难了,推了半天公式没推出来"; cout<<"不会了,太难了,推了半天公式没推出来"; } return 0;}```118 行未改动全部展开 } write(ans),putchar('\n'); } return 0;} }```
#### FJ-0305sale.cpp(cin<<)7 行未改动#onclude<icecream>using name space std;in mian(){
cuo<<hello?world; return 0; } }```
#### FJ-0321candy.cpp(别开香槟啊喂,9:缺少显式类型)7 行未改动 ll x,y;}candys[N];operator<(const pair<double,node>& __x, const pair<double,node>& __y) { return __x.first > __y.first;}priority_queue<pair<double,node>>q;//价格,(编号,1&2&3)//第一个,第二个,整套 priority_queue<pair<double,node>>q;//价格,(编号,1&2&3)//第一个,第二个,整套int main(){ freopen("candy.in","r",stdin); freopen("candy.out","w",stdout); scanf("%lld%lld",&n,&m);11 行未改动 if (ty==1 or ty==2){ sum+=1; if (ty==1) q.push({candys[mark].y,{mark,2}}); else if (ty==2) q.push({candys[mark].x,{mark,1}}); m-=pr; m-=pr; }else if (ty==3){ pr*=2;//总价 pr*=2;//总价 ll num=floor(m/pr); if (num>=1){ sum+=(num*2); m-=pr*num;4 行未改动 return 0;}/*我是最棒的~虽然鄙人技术较差OI无憾! OI无憾!*/```
#### FJ-035318 行未改动#### FJ-0410candy.cpp(无奖竞猜,猜猜哪错了)```cpp#include<bits/stdc++.h>#define int long long #define int long longusing namespace std;struct node{ int x,y;}a[10005];24 行未改动 for(int i=1;i<=n;i+=2){ if(a[i].x+a[i+1].x<=s){ m-=(a[i].x+a[i+1].x); ans+=2; } } if(i+1<=n&&a[i].x+a[i+1].x>s){ f=i; break; } } if(i==n){ f=i; break; }25 行未改动using namespace std;namespace sol{ #define int long long const int mod=1e9+7; const int mod=1e9+7; int a[5010],da[5010],jc[5010],inv[5010]; struct node { int a,w,p;120 行未改动全部展开}
int bin_se(int mm){ int lt=0,rt=n;
while(1){ if(abs(rt-lt)<=1){ if(check(rt,mm)) return rt; else return lt; }
int mid=(rt+lt)>>1;
if(check(mid,mm)) lt=mid; else rt=mid; }}
signed main(){
freopen("candy.in","r",stdin); freopen("candy.out","w",stdout);
ios::sync_with_stdio(false); cin.tie(0),cout.tie(0);
cin>>n>>m;
for(int i=1;i<=n;i++) cin>>num[i]._fir>>num[i]._sec,num[i].both=num[i]._fir+num[i]._sec;
sort(num+1,num+n+1,cmp);
int low_=num[1].both,use_num=m/low_;
for(int can_use=max(low_*(use_num-n),(int)0);can_use<=m;can_use+=low_) inter_.emplace_back(can_use/low_);
sort(num+1,num+n+1,cmp2);
for(int i=1;i<=n;i++) sum[i]=sum[i-1]+num[i]._fir;
for(int i:inter_){ int now_num=i*2,now_m=m-i*low_;
now_num+=bin_se(now_m);
ans=max(now_num,ans);
}
cout<<ans<<"\n";
return 0;}```剩余略79 行未改动
bool cmp2(candy c,candy d){ return c.x<=d.x ;
}bool cmp(candy x,candy y){ if(x.sum <=y.sum )28 行未改动 }}
while(k>=a[0].sum){ { k-=a[0].sum ; ans+=2;} sort(a,a+n,cmp2);233 行未改动全部展开candy.cpp```cpp#include "bits/stdc++.h"using namespace std;
#define bv(T) 0#define bn 0
#define NN printf("\n")#define iu(T) scanf("%lld",&T)#define ou(T) printf("%lld",T)
#define MN 100100#define U long long #define U long longU X[MN] ;U Y[MN] ;U m;U n;#define w(i,n) for(U i=0;i<n;i++)#define ws(i,s,n) for(U i=s;i<n;i++)#define ew(i,n) for(U i=n;i--;)#define ews(i,s,n) for(U i=n;i-->=s;)bool bA=true; bool bA=true;int main(){ freopen("candy.in","r",stdin); freopen("candy.out","w",stdout); iu(n);iu(m);
iu(n);iu(m);w(i,n){ iu(X[i] ); iu(Y[i] ); iu(X[i] ); iu(Y[i] ); if(X[i] !=Y[i] )bA=0;}U mx=0xFFffFFffFFffFFf;U mi; if(bA) { w(i,n) mx=min(mx,X[i] );
ou(n/mx); } else {4 行未改动 { if(X[i]+Y[i]<mx) mx=X[i]+Y[i],mi=i; } mxx= X[mi]; mxx= X[mi]; X[mi]=0xFFffFFffFFffFFf;
bool asd= (N-(N/mx)*mx>=mxx); sort(X,X+n); w(i,n) if(X[i]< (asd? mx: 0) ) N-=X[i],as++,bv(X[i]);
ou(as+(N/mx)*2); } /// 11 8 3 /// 11 8 3 fclose(stdin); fclose(stdout);
}```query.cpp```cpp#include "bits/stdc++.h"using namespace std;
#define bv(T) 0#define bn 0
#define NN printf("\n")#define iu(T) scanf("%lld",&T)#define ou(T) printf("%lld",T)
#define MN 100100typedef long long U;U A[MN] ;typedef unsigned long long ull;6 行未改动#define w(i,n) for(U i=0;i<n;i++)#define ws(i,s,n) for(U i=s;i<n;i++)#define ew(i,n) for(U i=n;i--;)#define ews(i,s,n) for(U i=n;i-->=s;)bool bA=true; bool bA=true; char Q[100];void fw(ull n){ {int i=0; while(n)Q[i++]=(n%10ull)+'0',n/=10ull; while(i)putchar(Q[--i]);}2 行未改动{ freopen("query.in","r",stdin); freopen("query.out","w",stdout);
iu(n); iu(n); w(i,n) iu(A[i] ); iu(q); w(j,q)
iu(q);
w(j,q) { U L,R; U L,R; iu(L);iu(R); U d=0; U d1=0; U li=0; U li1=0; U li=0; U li1=0; w(i,n) K[i]=-0xFFffFFffFFFFfff;
w(i,n) {
d+=A[i]; d1+=A[i]; if(i-li1>=R) if(i-li1>=R) { li1++,d1-=A[li]; } if(i-li>=R) if(i-li>=R) {
li++,d-=A[li];
}
if(d<0) d=0,li=i+1;
if(i-li+1>=L) ws(k,li,i+1) K[k]=max(K[k], d);
ws(k,li1,i+1) K[k]=max(K[k], d1); K[k]=max(K[k], d1); } ull as=0;// w(i,n) bv(K[i]); w(i,n) { // as^= (ull&)i*(ull&)K[i]; U ah= (i*K[i]);
as^=ah<0?0xFFFFffffFFFFffffull+ (ull)ah :ah ;}// as=//printf("%lld",as);NN; fw(as);NN; } /// 11 8 3
/// 11 8 3 fclose(stdin); fclose(stdout);
}```sale.cpp```cpp#include "bits/stdc++.h"using namespace std;
#define bv(T) 0#define bd(T) 0#define bn 0
#define NN printf("\n")#define iu(T) scanf("%lld",&T)#define ou(T) printf("%lld",T)
#define MN 100100#define U long long #define U long longU A[MN] ;
U m;U n; U c,t;#define w(i,n) for(U i=0;i<n;i++)#define ws(i,s,n) for(U i=s;i<n;i++)#define ew(i,n) for(U i=n;i--;)#define ews(i,s,n) for(U i=n;i-->=s;)bool bA=true; bool bA=true; U deff=0;
U mcl(U i,bool bh){// bool fgh=1;// vector<>10 行未改动 // bv( !!((i>>0)&1==0ll) ); while(q<64ll&&((i>>(q))&1)==0 ) q++ ; while(e1<64ll&&(i>>(e1))&1)e1++;e2=e1+1; while(e2<64ll&&(i>>(e2))&1)e2++;
U aq,ae1,ae2; aq=q<n?A[q]:0; ae1=e1<n?A[e1]:0; ae2=e2<n?A[e2]:0; // bv(q); bv(e1); bv(e2);
// bv(q); bv(e1); bv(e2); // bv(aq); bv(ae1);bv(ae2); bv(mm);
// if(bh&&(aq>=ae1+ae2) != (aq>=ae1*2) && fgh ) // { //fgh=0;
// deff++ ; // } if(aq>=(bh?ae1*2:ae1+ae2)&& mm>=2) { // bv("use2"); // bv(aq); q++; bd( aq); bd( aq); as+=aq, mm-=2; } else if(mm>=1) { e1++; bd( ae1); as+=ae1,mm-=1; } // else break; // else break; } bn; return as; // return 1;}
U as=0;int main(){//bv("k2"); freopen("sale.in","r",stdin);4 行未改动{iu(n);iu(m); w(i,n) { iu(A[i] );
iu(A[i] ); if(i&&A[i]!=A[i-1]) bA=false; } }if(bA){
ou( 1ll<<n);NN;6 行未改动as=0;deff=0; w(i,1ll<<n) { // as+=mcl(i,0);//==mcl(i,1) ; as+=mcl(i,0)==mcl(i,1) ;
// as+=mcl(i,0);//==mcl(i,1) ; as+=mcl(i,0)==mcl(i,1) ; // ou( mcl(i));NN; bn; } // bv(deff);
ou(as%998244353);NN; CNCN:;
CNCN:;} /// 11 8 3 /// 11 8 3 fclose(stdin); fclose(stdout);
}```tree.cpp```cpp36 行未改动