跳到正文

休闲·娱乐

2025 CSP-S SD 迷惑行为统计

OIer_sundingjia约 30 分钟
原文

这是 2025年11月4日 存档的第 2 版,不是当前版本。查看当前版本

文章信息与版本

文章信息

发布
2025年11月3日
收录
2025年12月12日
更新
2026年11月21日
篇幅
约 30 分钟

版本

  1. v6当前
  2. v5
  3. v4
  4. v3
更早的 2 个版本
  1. v2
  2. v1

由于个人保存不当,代码中中文注释全没了……。

可能等官方的程序包出来后再去修改(前提是那时我还在役)。

默哀区

在代码中搜索 //freopen,共在 8989 个文件中找到了 218218 个结果。

其中大部分是诈骗,但有 2323 个不是诈骗。大概率数错了。但我懒。

默哀。

SD-S00170

C++
#include<bits/stdc++.h>
#define push push_back
#define a first
#define b second
//rp++
using namespace std;
int n,m,k,x,y,z;
struct s{
	int x,y,z;
};
vector<s> v;
bool cmp(s a,s b){
	a.z<b.z;
}
int f[2000005];
int t[2000005];
bool p[2000005];
bool find(int x){
	if(f[x]==x)return x;
	else return f[x]=find(f[x]) ;
}
int main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	cin>>n>>m>>k;
	for(int i=1;i<=n+k;i++){
		f[i]=i;
	}
	for(int i=1;i<=m;i++){
		cin>>x>>y>>z;
		v.push({x,y,z});
	}
	for(int i=1;i<=k;i++){
		cin>>t[i+m];
		for(int j=1;j<=n;j++){
			cin>>z;
			v.push({i+m,j,z});
		}
	}
	sort(v.begin(),v.end(),cmp);
	int h=0;
	for(int i=0;i<m+n*k;i++){
		int tx=find(v[i].x),ty=find(v[i].y);
		cout<<v[i].x<<' '<<v[i].y<<' '<<v[i].z<<'\n';
		if(tx!=ty){
			f[tx]=ty;
			h+=v[i].z;
			if(p[tx]!=1){
				p[tx]=1;
				h+=t[tx];
			}
			if(p[ty]!=1){
				p[ty]=1;
				h+=t[ty];
			}
		}
	}
	cout<<h;
	return 0;
}
/*
4 4 2
1 4 6
2 3 7
4 2 5
4 3 4
1 1 8 2 4
100 1 3 2 4
*/

SD-S00223

C++
#include<bits/stdc++.h>
using namespace std;
const long long mod=998244353;
long long n,m,c[505],sum,ans=1;
string s;
int main(){
	freopen("employ3.in","r",stdin);
	//freopen("employ.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m>>s;
	for(int i=1;i<=n;i++){
		cin>>c[i];
	}
	s=" "+s;
	for(int i=1;i<=n;i++){
		sum+=(s[i]=='1');
	}
	if(sum<m){
		cout<<"0";
		return 0;
	}
	if(sum==n){
		for(int i=1;i<=n;i++){
			ans=ans*i%mod;
		}
		cout<<ans;
		return 0;
	}
	return 0;
}

不再列举了。

但这种诈骗很有必要贴出来:

SD-S00453

C++
#include<iostream>
using namespace std;
int main(){
	int n,m;
	freopen("replace.in","r",stdin);
	freopen("replace.out","w",stdout);
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		cout<<0<<endl;
	}
	//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen//freopen
	return 0;
}

共 6363 个freopen 。神经。


搜索 <bits\stdc++.h> ,共有 55 个结果。

但有一个不是诈骗:

SD-S00433

C++
#include<bits\stdc++.h>
#define _for(i,a,b) for(int i=(a);i<=(b);i++)
#define _rof(i,a,b) for(int i=(a);i>=(b);i--)
#define int ll
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
inline int read(){
	int f=1,num=0;
	char c=getchar();
	while(c<'0' || c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0' && c<='9'){num=(num<<3)+(num<<1)+(c^48);c=getchar();}
	return f*num;
}
int n,m,k;
int res;
struct e{
	int x,y,v,tp;
	bool operator>(const e& w)const{
		return v>w.v;
	}
};
priority_queue<e,vector<e>,greater<e>> q;
//vector<pair<int,int>> edge[10005];
bool usd[10005];
int c[15],d[15];
int p[15][10005];
int fa[10005];
inline int find(int u){return u==fa[u]?u:fa[u]=find(fa[u]);}
inline void solve(){
	int cnt=n-1;
	_for(i,1,n) fa[i]=i;
	while(cnt--){
		e x;
		while(1){
			x=q.top(),q.pop();
			if(find(x.x)!=find(x.y) && !usd[x.tp]) break;
		}
		
		fa[find(x.x)]=find(x.y);
//		printf("%lld %lld %lld %lld\n",x.x,x.y,x.v,x.tp);
		res+=x.v;
		
		if(x.tp){
			usd[x.tp]=1;
			_for(i,1,n) if(i!=d[x.tp]){
				q.push({d[x.tp],i,p[x.tp][i],0});
			}
		}
	}
}
signed main(){
	freopen("road.in","r",stdin);
	freopen("road.out","w",stdout);
	n=read(),m=read(),k=read();
	_for(i,1,m){
		int x=read(),y=read(),v=read();
		q.push({x,y,v,0});
	}
	_for(i,1,k){
		c[i]=read();
		int mn=1e9+10,ind=1;
		_for(j,1,n){
			p[i][j]=read();
			if(p[i][j]<=mn)
				mn=p[i][j],ind=j;
		}
//		printf("%lld\n",ind);
		d[i]=ind;
		_for(j,1,n) if(j!=ind){
			q.push({ind,j,mn+c[i]+p[i][j],i});
		}
	}
	solve();
	printf("%lld\n",res);
	return 0;
}
//i love ccf

9292 (梦熊数据) -> 00 。

祝好。


搜索 #incldue<windows.h>,共 11 个结果。且不是诈骗,并导致挂分。

SD-S00307

C++
#include<bits/stdc++.h>
#include<windows.h>
#define ll long long
#define sdn cout
#define pb push_back
using namespace std;
const int N = 1e4 + 100,M = 2e6 + 100,INF = 1e9 + 7;
int a[12][N],idx,n,m,k,op[11];
ll sm,ans;
struct edge{
	int x,y,z;
	bool operator <(const edge &p)const{
		return z < p.z;
	}
}e[M],e1[M];
vector <int> lk[N];
struct sorasaki_hina{
	int f[N],siz[N];
	void init(){
		for(int i = 1;i < N;i ++)  f[i] = i,siz[i] = 1;
	}
	int find(int x){
		if(f[x] != x)  f[x] = find(f[x]);
		return f[x];
	}
 	void mg(int x,int y){
		if(siz[x] > siz[y])  swap(x,y);
		f[x] = y,siz[y] += siz[x]; 
	}
}b;
inline void check(){
	sm = 0;b.init();
	vector <int> lk[12];
	int cnt = 1,x = 1,opt = n;
	for(int i = 1;i <= m;i ++){
		e1[i] = e[i];
	}
	int idx = m;
	for(int i = 1;i <= k;i ++){
		if(op[i]){
			sm += a[i][0];opt ++;
			for(int j = 1;j <= n;j ++){
				e1[++idx] = (edge){i+n,j,a[i][j]};
			}
		}
	}
	sort(e1+1,e1+idx+1);
	while(cnt < opt&&x<=idx){
		int u = e1[x].x,v = e1[x].y;
		int uu = b.find(u),vv = b.find(v);
		if(uu == vv){
			x ++;continue;
		}
		sm += e1[x].z;b.mg(uu,vv);
		if(u < v)  swap(u,v);
		if(u > n)  lk[u-n].pb(v);
		x ++;cnt ++;
	}
	for(int i = 1;i <= k;i ++){
		if(lk[i].size()==1)
		  sm -= (a[i][0]+a[i][lk[i][0]]);
	}
	ans = min(ans,sm);
}
inline void dfs(int x){
	if(x > k){
		check();
		return ;
	}
	op[x] = 0;dfs(x+1);
	op[x] = 1;dfs(x+1);
}
inline int read(){
	int x = 0;
	char c = getchar();
	while(c < '0' || c > '9'){
		c = getchar();
	}
	while(c <= '9' && c >= '0'){
		x = x*10+(c-'0');
		c = getchar();
	}
	return x;
}
int main(){
	freopen("road.in","r",stdin);
	freopen("road.out","w",stdout);
	b.init();ans = 1e18;
	bool f = 1;
	n = read(),m = read(),k = read();
	for(int i = 1;i <= m;i ++){
		int u,v,w;
		u = read(),v = read(),w = read();
		e[i] = (edge){u,v,w};
	}
	for(int i = 1;i <= k;i ++){
		for(int j = 0;j <= n;j ++){
			a[i][j] = read();
		}
		if(a[i][0] != 0)  f = 0;
		bool ff = 0;for(int j = 1;j <= n;j ++){
			if(a[i][j] == 0)  ff = 1;
		}
		f = f&ff;
	}
	if(f){
		for(int i = 1;i <= k;i ++){
			op[i] = 1;
		}
		check();
		sdn<<ans;
		return 0;
	}
	dfs(1);
	sdn<<ans<<endl;
	return 0;
}

搜索 .ans" ,有 1919 个结果。

去除对拍,还有 88 个结果。

其中有 66 个不是诈骗,并由 22 个人贡献。

默哀。

SD-S01103

这个人在 44 个文件中贡献了 44 次。

C++
#include<bits/stdc++.h>
using namespace std;
int n,q,L,lena,minn=99999999,maxn,ans;
string s[200001][2],t1,t2;char a[10001];
int main()
{
	freopen("replace.in","r",stdin);
	freopen("replace.ans","w",stdout);
	cin>>n>>q;
	for(int i=1;i<=n;i++){cin>>s[i][0]>>s[i][1];}
	for(int i=1;i<=q;i++)
	{cin>>t1>>t2;
	/*
	 ans=0;
	 L=t1.length();
	 for(int j=1;j<=L;j++)
	 {
	 	if(t1[j]!=t2[j])
	 	{
	 		maxn=max(j,maxn);
	 		minn=min(j,minn);
		}
	 }
	 lena=maxn-minn+1;
	 for(int j=1;j<=n;j++)
	 	for(int g=1;g<=s[i][0].length();g++)
	 	{
	 		
		}
		*/
		cout<<0<<endl;
	}
	
	return 0;
 }

C++
#include<bits/stdc++.h>

using namespace std;

int main()
{
	freopen("road.in","r",stdin);
	freopen("road.ans","w",stdout);
	int m,n,k,a,b,c;
	cin>>m>>n>>k;
	for(int i=1;i<=3*m+k*(n+1);i++) cin>>a;
	cout<<0;
	return 0;
 }
C++
#include<bits/stdc++.h>
using namespace std;
int a[100001][3],A,B,C,n,t,maxn,happy,b[20001],c[20001];
int club(int stu)
{
	if (stu>=n+1) maxn=max(happy,maxn);
	else
	{
		if(A>0){A--; happy+=a[stu][0]; club(stu+1); A++; happy-=a[stu][0];}
		if(B>0){B--; happy+=a[stu][1]; club(stu+1); B++; happy-=a[stu][1];}
		if(C>0){C--; happy+=a[stu][2]; club(stu+1); C++; happy-=a[stu][2];}
	}
 } 
int main()
{
	freopen("club.in","r",stdin);
	freopen("club.ans","w",stdout);
	cin>>t;
	for(int i=1;i<=t;i++)
	{
		maxn=0;
		cin>>n;
		for(int j=1;j<=n;j++)
		{
			cin>>a[j][0]>>a[j][1]>>a[j][2];
		}
		if(n>3)
			{if(a[1][2]==a[2][2]&&a[3][2]==a[2][2]&&a[3][2]==0)
				{if(a[1][1]==a[2][1]&&a[3][1]==a[2][1]&&a[3][1]==0)
					{A=n/2;
					for(int j=1;j<=n;j++){b[a[j][0]]++;}
					for(int j=20000;A>0;j--)
					{
						while(b[j]>0&&A>0)
						{
							A--; maxn+=j; b[j]--;
						}
					}
					cout<<maxn<<endl; continue;
					}
				else
					{
					A=B=n/2;
					for(int j=1;j<=n;j++)
						{
						maxn+=max(a[j][0],a[j][1]); 
						b[abs(a[j][0]-a[j][1])]++;
						if(a[j][0]>a[j][1]) {A--;c[abs(a[j][0]-a[j][1])]++;}
						else {B--;b[abs(a[j][0]-a[j][1])]++;}
						}
					if(A<0){
					A=abs(A);
					for(int j=0;A>0;j++)
					{
						while(c[j]>0&&A>0)
						{
							A--; maxn-=j; c[j]--;
						}
					}}
					else
					{
						for(int j=0;A>0;j++)
						{
							while(b[j]>0&&A>0)
							{
								A--; maxn-=j; b[j]--;
							}
						}
					}
					cout<<maxn<<endl; continue;
					}
				}
			else
			if(n>9999)
			{
				for(int j=1;j<=n;j++)
				maxn+=max(a[j][0],max(a[j][1],a[j][2]));
				cout<<maxn<<endl; continue;
			 } 
			}
		A=B=C=n/2;
		club(1);
		cout<<maxn<<endl;
	}
	return 0;
 }
C++
#include<bits/stdc++.h>
using namespace std;
long long n,m,c[501],b[501],sum,ans;//c���� b��Ŀ 
bool p[501],lu[501],flag;//¼Ϊ1 
string a;
const int mo=998244353;
//998244353
long long jc(int x)
{
	int u=1;
	for(int i=x;i>=1;i--) u=(u*i)%mo;
	return u;
}
void pailie(int x,int y)//��ǰ���� ��¼ȡ 
{
	if(x>n) return;
	int temp,s; s=y;
	for(int i=1;i<=n;i++)
	{
		if(p[i]==0)
		{if(b[x]==1)
			{if(x>c[i])
				{
					temp=0;
					for(int j=x-c[i];j<x;j++) temp+=lu[j];
					if(temp!=0) {lu[x]=1; s=y-1;}
				}
			 else {lu[x]=1; s=y-1; }
		}
			if(s==0) {ans=(ans+jc(n-x))%mo;}
			else {p[i]=1;pailie(x+1,s);p[i]=0;lu[x]=0;}
		}
	}
}
int main()
{
	freopen("employ.in","r",stdin);
	freopen("employ.ans","w",stdout);
	cin>>n>>m>>a;
	for(int i=1;i<=n;i++)
	{
		cin>>c[i];
		b[i]=a[i-1]-'0';
		sum+=b[i]; 
		if(c[i]==0) flag=1;
	}
	if(m==n){if(sum!=n||flag!=0) cout<<0; else cout<<jc(n); return 0;}
	if(m>sum){cout<<0; return 0;}
	pailie(1,m);
	cout<<ans;
	return 0;
 }

祝好。

另一个人是: SD-S00168。


以下数字统计可能有误,欢迎修改。

feropen 出现了 1414 次,int mian 出现 22 次。

好消息:全部是诈骗。


road1.in/out/ans 在 freopen 里出现了 55 次,有 00 个是诈骗。

road2.in/out/ans 在 freopen 里出现了 22 次,有 22 个是诈骗。

road3.in/out/ans 在 freopen 里出现了 88 次,有 55 个是诈骗。

road4.in/out/ans 在 freopen 里出现了 1010 次,有 1010 个是诈骗。


replace1.in/out/ans 在 freopen 里出现了 77 次,有 55 次是诈骗。

replace2.in/out/ans 在 freopen 里出现了 22 次,有 00 次是诈骗。

replace3.in/out/ans 在 freopen 里出现了 77 次,有 66 次是诈骗。

replace4.in/out/ans 在 freopen 里出现了 1111 次,有 99 次是诈骗。


club1.in/out/ans 在 freopen 里出现了 1111 次,有 77 次是诈骗。

club2.in/out/ans 在 freopen 里出现了 22 次,有 22 次是诈骗。

club3.in/out/ans 在 freopen 里出现了 55 次,有 44 次是诈骗。

club4.in/out/ans 在 freopen 里出现了 88 次,有 88 次是诈骗。

club5.in/out/ans 在 freopen 里出现了 1313 次,有 1313 次是诈骗。


employ1.in/out/ans 在 freopen 里出现了 88 次,有 77 次是诈骗。

employ2.in/out/ans 在 freopen 里出现了 44 次,有 22 次是诈骗。

employ3.in/out/ans 在 freopen 里出现了 88 次,有 66 次是诈骗。

employ4.in/out/ans 在 freopen 里出现了 33 次,有 33 次是诈骗。

employ5.in/out/ans 在 freopen 里出现了 44 次,有 44 次是诈骗。


fuck 出现了 1010 次,并且 fuck ccf 出现了 66 次。禁赛三年警告。

PS. CCF 在所有代码中出现了 304304 次,分布在 7070 个文件中。

点名两个人:

SD-S00527

以一己之力,贡献了 185185 个CCF 。

C++
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define fi first
#define se second
#define pb push_back
#define add(u,v,w) tu[(u)].pb({(v),(w)})
#define forr(x,y) for(int i=x;i<=y;i++)
#define endl '\n'
const int inf=0x3f3f3f3f;
const ll infll=0x3f3f3f3f3f3f3f3f;
int main(){
	freopen("replace.in","r",stdin);
	freopen("replace.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	while(1); 
	return 0;
} 
//CCF is good
//CCF is good
//CCF is good
//CCF is good
//CCF is good

/*
---- 省略 180 个 CCF is good----
*/

SD-S01524

请最大化后观看。

C++
/*
CCF CCF CCF CCF    CCF CCF CCF CCF     CCF CCF CCF CCF         is    is is is is
CCF                CCF                 CCF                           is
CCF                CCF                 CCF CCF CCF CCF         is    is is is is      
CCF                CCF                 CCF                     is             is
CCF CCF CCF CCF    CCF CCF CCF CCF     CCF                     is    is is is is  .................
*/  

不做评价。

代码长度这一块

最长代码由两个 8585 KB 的代码取得。

SD-S01036&00778

C++
#include<iostream>
using namespace std;
int main(){
	freopen("replace.in","r",stdin);
	freopen("replace.out","w",stdout);
	int n,m;
	cin>>n>>m;
	if(n==4 and m==2){
		cout<<0<<'\n'<<2;
	}
	if(n==3 and m==4){
		printf("0\n0\n0\n0\n");
	}
	if(n==37375 and m==27578){
		printf(/*省略 82Kb 大样例内容*/);
		
	}
	if(n==2235 and m==1010){
		printf(/*省略 3Kb 大样例内容*/);
		
	}
	else{
		for(int i=0;i<m;i++){
			cout<<0<<'\n';
		}
	}
	return 0;
	fclose(stdin); 
	fclose(stdout); 
}

神人。

共有 66 个代码超过 1010 KB。

除去注释超过 1010 KB 的和两份神人无意义代码,还剩两份有意义的。

有一个巨佬(SD-S01410) T2 写了写了 1313 KB代码,并在本地成功过编,但交上去 CE 了…………。

默哀。

还有另一份 T4 代码,(作者 SD-S00031),写的像一个艺术品。

防止破坏观感,我放在这里。

这份代码取得了 [0,8][0,8] 分的好成绩。

全场最短代码由多个人同时取得:

代码

(以上为代码全文)。


一些小统计

#define int long long 出现了 11001100 余次。

ios::sync_with_stdio 出现了 17501750 次。你不能再说他们不能用了。

字符画这一块

如果你想上去,你可以把你的准考证号发给作者。

SD-S01264

代码
       CCCCCCCCC     CCCCCCCCCC      FFFFFFFFFFF 
	   C             C               F
	   C             C               F        
	   C             C               F
	   C             C               FFFFFFFFFFF
	   C             C               F
	   C             C               F       
	   CCCCCCCCC     CCCCCCCCCC      F

您在这种花呢?

SD-S00333

C++
    ***
 *  *   *
  **  *  *
 **   *   *      duck
* *       *
  *       ***********
  *       ***      *
  *          *    *
  *       ***    *
  *********************************
        ********      ******
    ***********************      **
    **      ***           *********
  *********************************

SD-S00495

代码
/*
--------            	  ��    |
|   ,					---- |--|--|       
| |---|					  /  |--|--|
| |---|					 /|  |--|--|
| |---|					  |     |
|  .|.				      |     |
*/

原神巨佬 %%%

同上

代码
  	  ^^^^^^^^^^^^ 
     (   ��    �� )
      |         |
------|         |-------()
      |         |
      ----------
  	  \         \
  	  \         \
   	  |         |

我在尝试看懂他在画什么。

盒子这一块

彩蛋 1

SD-S01020 出现在了两个不同人的代码里。

神秘。

开盒环节:

帮你们开了,不用谢。

SD-S00161: @China_DeepSeek 。

SD-S00433: @undefined_behavior 。

SD-S00436: @Meng_Xiangyu。

****:

****:

****:

****:

****:

****:

****:

****:

****:

****:

****:

****:

****: