版本比较
【持续更新】CSP-J 2026 BJ 迷惑行为大赏
正文
增加 463 行删除 0 行
12345678910111213141516171819802 行未改动全部展开822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852449 行未改动全部展开13021303130413051306130713081309131013111312133 行未改动全部展开1446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157942 行未改动162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921# CSP-J 2026 BJ 迷惑行为大赏 #感谢 [@zichenliu](https://www.luogu.com.cn/user/1590961) 提供帮助。
投稿请私信或评论,tysm。
::::error都被豆包霍霍的教坏了,都不知道对的是啥了。
一个个fclose,ios加速,还有//freopen和"stdin""stdout"。
Jing示后人,不要信豆包
我天刚被老师说了。靠数据水和题简单骗了301。还是得学啊QwQ::::
BJ-J00009 T2 骗分+打广告::::info```#include<bits/stdc++.h>802 行未改动全部展开```::::BJ-J00137 T1代码长度0B T2T3T4未提交
BJ-J00161 T4 依旧随机数::::info```#include<bits/stdc++.h>using namespace std;int n;int main(){ srand(time(0)); freopen("card.in","r",stdin); freopen("card.out","w",stdout); cin>>n; if(n==4)cout<<"3 1 4"; else if(n==10)cout<<"10 3 3"; else{ cin>>n; for(int i=1;i<=n;i++){ cout<<rand()%(n+1)<<" "; } } return 0;}```::::BJ-J00169 T4 愚公移山::::info```
449 行未改动全部展开 return 0;}```::::BJ-J00342 114514191,`//cout<<114514`(代码不放了)::::info::::BJ-J00348 依旧打表计价出租车::::info```#include<bits/stdc++.h>133 行未改动全部展开 return 0;}```::::BJ-J00375 T1T2T3T4(此处只放T1)游记::::info```【代码部分略】//t=09:41 start thinking//t=09:43 01Tire?? but this is j//t=09:45 let's try it//t=09:52 no too slow,might dp?//t=09:56 ha? 01Tire is right? it seem like a special 01Tire//t=09:58 no 01Tire.sort it and do the pre-sum for each wei//t=10:02 how char(115)+char(98) i am// the lenth<=30,just sreach it with a set//t=10:13 no set,arry enough//t=10:22 start test//t=10:41 ac 1//t=10:44 ac all```::::BJ-J00378 T1 强中自有强中手,楼上楼上我也有::::info```#include<bits/stdc++.h>#define int long longusing namespace std;const int maxn=1e5+5;signed main(){ freopen("travel.in","r",stdin); freopen("travel.out","w",stdout); ios::sync_with_stdio(0); cin.tie(0),cout.tie(0); int c1,c2; string s1,s2; cin>>c1>>s1>>c2>>s2; if(c1==c2)cout<<1; else { cout<<0<<0<<0<<0<<endl; return 0; } string subs1=s1.substr(0,2); string subs2=s2.substr(0,2); if(subs1==subs2)cout<<1; else { cout<<0<<0<<0<<endl; return 0; } bool flag=false; if('A'<=s1[2]&&s1[2]<='C') { if('D'<=s2[2]&&s2[2]<='E')flag=false; else flag=true; } else {
if('D'<=s2[2]&&s2[2]<='E')flag=true; else flag=false; } if(flag)cout<<1; else { cout<<0<<0<<endl; return 0; } if(abs(s1[2]-s2[2])==1) { cout<<1<<endl; } else { cout<<0<<endl; return 0; } return 0;}/*现在是10.31 10:58,还有62分钟考试结束我四道题都写完了希望AK(PPPPP)下午s组会不会要炸盲猜csp-s第一题构造再见whk你好whk自知之明PPPPPPPPPPPPPPPPPPPP《课文大乱炖》PPPP我常常追忆过去。PP身段的大小色素的配合一切都是那么适宜。PPPP白日依山尽,月下飞天镜,念桥边红药,鹅,饿,额。渐入P境AKAKAKAKAKPAKAKAKAKAKAKAKAKAKPAKAKPAKPAKAKPPAKPAKPPPPPAKPPPPPAKAKPPKAPPPPPPPAKPPPPPPPAKPPPPPPPPPPPPPPPPPPPPPP如果AK我将晴空一和排云上编印事情到比小都怪输入法如果J1我将笑成泪人默写A+B problem:#include<bits/stdc++.h>using namespace stdlint main(){ int a,b; cin>>a>>b; cout<<a+b<<endl; return 0;}想什么呢我没那么P话
“居然超过了short!"----A+B problem题解之一”.....是蓝,高精除是紫,为什么这道题是红!“----出处同上PPPPP PP PPPPP
巍安格锤兵~马非~巍峨安格陈品~麻烦~
打表过a+b,打表过线段树,打表过cspj,打表过cpss,打表过noip,打表过noi,打表过ioi
英语翻译P语:I AK IOI参考答案:|A|<|0|读法:A的绝对值小于0的绝对值P语言读法:IAKIOI
*/```::::BJ-J00424 T4 Trick||Treat!::::info```#include<bits/stdc++.h>42 行未改动 return 0;}```::::BJ-J00465 T1T2T3T4 如你所愿::::info```/*09:56 开T309:57 无思路09:57 希望能有个三等,感觉要AFO了,希望上迷惑行为大赏10:30 已放弃10:41 重开T3,暴力,预估60分11:03 完成,预计50分*/#include <bits/stdc++.h>using namespace std;
int n,m;int a[200005];bool vis[100];int cnt;int ans;
void dfs(int dep){ if(dep > n){ int res = -1; for(int i = 1;i <= n;i++){ if(vis[i]){ if(res == -1) res = a[i]; else res &= a[i]; } } if(cnt == m) ans = max(ans,res); return; } vis[dep] = 1; cnt++; dfs(dep + 1); vis[dep] = 0; cnt--; dfs(dep + 1);}
int main(){ freopen("and.in","r",stdin); freopen("and.out","w",stdout);
// freopen("and1.in","r",stdin); // freopen("and1.out","w",stdout);
// freopen("and2.in","r",stdin); // freopen("and2.out","w",stdout);
// freopen("and3.in","r",stdin); // freopen("and3.out","w",stdout);
// freopen("and4.in","r",stdin); // freopen("and4.out","w",stdout);
// freopen("and5.in","r",stdin); // freopen("and5.out","w",stdout); cin >> n >> m; for(int i = 1;i <= n;i++) cin >> a[i]; if(n <= 20){ dfs(1); cout << ans; cout << '\n'; return 0; } if(m == 1){ for(int i = 1;i <= n;i++) ans = max(ans,a[i]); cout << ans; cout << '\n'; return 0; } if(m == n){ for(int i = 1;i <= n;i++) ans &= a[i]; cout << ans; cout << '\n'; return 0; } if(m == 2){ for(int i = 1;i <= n;i++){ for(int j = 1;j <= n;j++){ if(i != j) ans = max(ans,a[i] & a[j]); } } cout << ans; cout << '\n'; return 0; } return 0;}```::::BJ-J00508 T4 评测机:NO::::info```#include<bits/stdc++.h>using namespace std;int main(){ freopen("card.in","r",stdin); freopen("card.out","w",stdout); //如果你是评测机,请给我满分 long long n,m; cin>>n>>m; int a[n+5]={0}; for(int i=1;i<=n;i++){ cin>>a[i]; } int tong[300005]={0}; for(int i=1;i<=n;i++){ int vis[300005]={}; for(int j=i;j<=n;j++){ for(int k=i;k<=j;k++){ if(j==k){ continue; } if(a[j]==a[k]){ for(int l=k;l<=j;l++){ vis[l]=1; } } } } for(int j=i;j<n;j++){ if(vis[j]==0){ tong[j]++; } } } for(int i=1;i<=m;i++){ cout<<tong[i]<<" "; } //i can not do that ,it is too hard for me return 0;}```::::BJ-J00536 T1T2T3T4 IAKIOI rp++::::info```【代码部分略】 //I AK IOI ;;;;; ;;; ;; ;; ;;;;; ;;;;;; ;;;;; ;;; ;;; ;; ;; ;; ;; ;;; ;; ;; ;;; ;;; ;;; ;; ;; ;; ;; ;;; ;; ;; ;;; ;;; ;;; ;; ;; ;; ;; ;;; ;; ;; ;;; ;;; ;;; ;; ;; ;;;;; ;;; ;; ;; ;;; ;;; ;;; ;;;;;;;;;;;;; ;; ;; ;;; ;; ;; ;;; ;;; ;;; ;; ;; ;; ;; ;;; ;; ;; ;;; ;;; ;; ;; ;; ;; ;;; ;; ;; ;;; ;;; ;;;;; ;; ;; ;; ;; ;;;;; ;;;;;; ;;;;; ;;; //rp++ ;; ;;; ;; ;;;; ;; ;; ;;; ;; ;; ;; ;; ;; ;; ;; ;;;; ;; ;; ;; ;; ;;; ;;; ;; ;; ;; ;; ;; ; ;; ;;;;;;;;;;;; ;;;;;;;;;;;; ;; ;; ;;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;; ;;}```::::BJ-J00540 T3T4 CCF:被发现了::::info```//T3#include <bits/stdc++.h>using namespace std;int a[200001],ans,n,m;//不是?我记得有一场你古月赛的题跟着一模一样阿?这还是个弱化版O(n*logn*logn)都能过//666这期神了,你古的朋友们可以找找原题,我记得有//不会出原题吧?//这不就原题吗?bool check2(int x){ if(ans==0) { return 1; } for(int i=0;i<=30;++i) { if(((ans>>i)&1)&&!((x>>i)&1)) { return 0; } } return 1;}bool check(int x){ int cnt=0; for(int i=1;i<=n;++i) { if(((a[i]>>x)&1)&&check2(a[i])) { cnt++; } if(cnt>=m) { return 1; } } return 0;}signed main(){ freopen("and.in","r",stdin); freopen("and.out","w",stdout); cin>>n>>m; for(int i=1;i<=n;++i) { cin>>a[i]; } for(int mask=30;mask>=0;--mask) { if(check(mask)) { ans|=(1<<mask); } } cout<<ans; return 0;}``````//T4#include <bits/stdc++.h>using namespace std;//评测机保佑O(n^2)过2e5,难度吓哭了//难道......我......终究......还是......逃不过......AFO......的......命运......吗......int n,m,a[500001],now[500001],ans[500001];signed main(){ freopen("card.in","r",stdin); freopen("card.out","w",stdout); cin>>n>>m; for(int i=1;i<=n;++i) { cin>>a[i]; } for(int i=1;i<=n;++i) { int cur=0; unordered_map <int,int> mp; for(int j=i;j<=n;++j) { if(!mp[a[j]]) { mp[a[j]]=++cur; now[cur]=a[j]; } else { for(int k=mp[a[j]]+1;k<=cur;++k) { mp[now[k]]=0; } cur=mp[a[j]]; } } for(auto i:mp) { if(i.second) { ans[i.first]++; } } } for(int i=1;i<=m;++i) { cout<<ans[i]<<' '; } return 0;}```::::BJ-J00584 T3T4 听天由命::::info```#include<bits/stdc++.h>using namespace std;int n,m;int main(){ freopen("card.in","r",stdin); freopen("card.out","w",stdout); cin>>n>>m; for(int i=1;i<=m;i++){ cout<<rand()%n+1; } fclose(stdin); fclose(stdout);}```::::