跳到正文

休闲·娱乐

CSP-S 2026 迷惑行为大赏 AH(V26.0 Developer Beta 1)

LaoXu666约 48 分钟
原文

这是 2026年11月11日 存档的第 1 版,不是当前版本。查看当前版本

文章信息与版本

文章信息

发布
2026年10月22日
收录
2026年11月11日
更新
2026年11月19日
篇幅
约 48 分钟
获赞
1

版本

  1. v2当前
  2. v1

速览

搜索 ccf:77 个文件内有 88 个结果。

搜索 luogu:77 个文件内有 99 个结果。

搜索 洛谷:11 个文件内有 11 个结果。

搜索 rp++:1212 个文件内有 1212 个结果。

搜索 rp:3030 个文件内有 7777 个结果。

搜索 //freopen:4343 个文件内有 7474 个结果。

搜索 // freopen:33 个文件内有 44 个结果。

搜索 // freoepn:22 个文件内有 22 个结果。

搜索 froepen:44 个文件内有 44 个结果。(全是作者钓鱼的)

搜索 #define int long long:560560 个文件内有 561561 个结果。

搜索 Oct31==Dec25?:5858 个文件内有 5858 个结果。

搜索 1.in 1.out 1.ans 2.in 2.out 2.ans 3.in 3.out 3.ans 4.in 4.out 4.ans 5.in 5.out 5.ans 6.in 6.out 6.ans 7.in 7.out 7.ans:4747 个文件内有 4747 个结果。(总和)

搜索 .ans:1717 个文件内有 3434 个结果。

更多信息(Developer Beta 1,仅有S00001~S00100)

AH-S00003:不可以总司令,但是题目没有No

hub.cpp

C++
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int main(){
    freopen("hub.in","r",stdin);
    freopen("hub.out","w",stdout);
    printf("No!");
    return 0;
}

AH-S00005:骗分人

hub.cpp

C++
#include<bits/stdc++.h>
#define int long long
using namespace std;
int c, t, n, k;
signed main()
{
    freopen("hub.in", "r", stdin);
    freopen("hub.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> c >> t;
    while(t--)
    {
        cin >> n >> k;
        for(int i=0; i<n-1; i++)
        {
            int u, v;
            cin >> u >> v;
        }
        if(n == 5)cout << 1 << endl;
        if(n == 6)cout << 1 << endl;
        if(n == 8)cout << 1 << endl;
        if(n == 9)cout << 2 << endl;
        if(n == 10)cout << 2 << endl;
        if(n == 88)cout << 6 << endl;
        if(n == 386)cout << 6 << endl;
        if(n == 562)cout << 9 << endl;
        if(n == 602)cout << 17 << endl;
    }
    return 0;
}

migrate.cpp

C++
#include<bits/stdc++.h>
#define int long long
using namespace std;
int c = 0, t = 0, n = 0, d = 0;
int island[2000005];
signed main()
{
    freopen("migrate.in", "r", stdin);
    freopen("migrate.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> c >> t;
    while(t--)
    {
        for(int i=0; i<2000005; i++)island[i] = 0;
        cin >> n >> d;
        for(int i = 0; i<n; i++)
        {
            cin >> island[i];
        }
        if(n == 4)cout << 1 << endl;
        if(n == 5)cout << 2 << endl;
        if(n == 6)cout << 1 << endl;
        if(n == 20)cout << 341 << endl;
    }
    return 0;
}

AH-S00006

migrate.cpp:67

C++
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll c,t,n,d,a[5010],ans;
int main(){
    freopen("migrate.in","r",stdin);
    freopen("migrate.out","w",stdout);
    cout<<6767676767;
    return 0;
}

AH-S00010

其在crystal, hub, migrate三题中最后都注释了zap,合理怀疑是署名;在subway一题中交了check.cpp,让我们为他默哀

AH-S00017

C++
#include<iostream>
#include<algorithm>
#include<cstdio>
#define int long long
using namespace std;
bool flag;
int n,m,a[500005],sum[500005],ans,pos;
signed main(){
    freopen("crystal.in","r",stdin);
    freopen("crystal.out","w",stdout);
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        sum[i]=sum[i-1]+a[i];
    }
    for(int i=2;i<=n;i++){
        if(a[i]-a[i-1]!=a[2]-a[1]) flag=1;
    }
    if(!flag){
        for(int i=1;i<=n;i++){
            m-=i*(a[2]-a[1]);
            if(m<0){
                cout<<i;
                break;
            }
        }
        return 0;
    }
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            int tmp=(j-i)*a[j]-(sum[j-1]-sum[i-1]);
            if(tmp<=m){
                int tmp1=j-i+1;
                if(pos<tmp1){
                    pos=tmp1;
                }
            }
        }
    }
    cout<<pos;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
/*chu yi tiao zhan -S   tiao zhan shi bai*/

后面注释说的:初一挑战-S,挑战失败

AH-S00023:默哀

C++
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,c,t,d,x[10005][10005],a=0;
    cin>>c;
    if(c==0){
        freopen("migrate.in","r",stdin);
        freopen("migrate.out","w",stdout);
    }else if(c==1){
        freopen("migrate1.in","r",stdin);
        freopen("migrate1.out","w",stdout);
    }else if(c==2){
        freopen("migrate2.in","r",stdin);
        freopen("migrate2.out","w",stdout);
    }else if(c==3){
        freopen("migrate3.in","r",stdin);
        freopen("migrate3.out","w",stdout);
    }else if(c==4){
        freopen("migrate4.in","r",stdin);
        freopen("migrate4.out","w",stdout);
    }else if(c==5){
        freopen("migrate5.in","r",stdin);
        freopen("migrate5.out","w",stdout);
    }else if(c==6){
        freopen("migrate6.in","r",stdin);
        freopen("migrate6.out","w",stdout);
    }
    cin>>t;
    for(int i=1;i<=t;i++){
        cin>>n>>d;
        for(int j=1;j<=n;j++){
            cin>>x[i][j];
        }
    }
    for(int i=1;i<=t;i++){
            a=0;
        for(int j=1;j<=n;j++){
            if(x[i][j+2]-x[i][j]==2){
                a++;
            }
        }
    cout<<a<<endl;
    }
    return 0;
}

AH-S00025:迷惑数组定义

C++
crystal.cpp
#include<bits/stdc++.h>
using namespace std;
long long &n[100000],&m[1000000000000000000];
int main(){
    freopen("crystal.in","r",stdin);
    freopen("crystal.out","w",stdout);
    scanf("%d%d",&n,&m);
  for(int i>=1;i<=n;i++){
         s[i]/=1;
         a+=1;
        a[1]+m=a[2];
       }else{
          x=a[1]+a[2];
    }
printf("%d",&x);
   return 0;
 }
hub.cpp
#include<bits/stdc++.h>
using namespace std;
long long  &c[20],&t[5],&n[1000000],&k;
int main(){
    freopen("hub.in","r",stdin);
    freopen("hub.out","w",stdout);
    scanf("%d%d%d%d",&c,&t,&n,&k);
  for(int i>=1;i<=n-1;i++){
       i + 1=n-1;
       s[i]/=1;
    }
    for(int i>=1;i<=n;i++){
        if(n=2m+1&&u[i]=i&&v[i]=i+1);
        else{
            u[i]=i−m&&v[i]=i+1;
        }
    }
  printf("%d",&n);
   return 0;
 }
migrate.cpp
#include<bits/stdc++.h>
using namespace std;
long long  &c[25],&t[100000],&n[2000000],&d[2000000000000000000];
int main(){
    freopen("migrate.in","r",stdin);
    freopen("migrate.out","w",stdout);
    scanf("%d%d%d%d",&c,&t,&n,&d);
     if(c==0);
        else{
            (x[1],x[2])!=m-1;
        }
        for(int i>=1;i<=n;i++){
            s[i]<=d;
            l=m-1;
        }
        for(int j>0;j<=n;j++){
            s[j]<=d;
            x[n]-x[1]<=10d;
        }
  printf("%d",&l);
   return 0;
 }
subway.cpp
#include<bits/stdc++.h>
using namespace std;
long long  &n[500],&c[25],&m,&d[20],&q[100000];
int main(){
    freopen("subway.in","r",stdin);
    freopen("subway.out","w",stdout);
    scanf("%d%d%d%d%d",&c,&n,&m,&d,&q);
  for(int i>=1;i<=n;i++){
       i + 2 %1=1 + 2k;
       s[i]/=1;
         r+=1;
         m=w[1]+t[1,1]+(t[1,2]+t[2,2])+t[2,3]+w[3]...+w[m];
       }else{
        m=w[1]+t[1,1]+t[1,2]+w[2]...+w[m-1];
        t[i,j]=T;
    }
  printf("%d%d",&m,&T);
   return 0;
 }

AH-S00031:依旧骗分人

hub.cpp

C++
#include <bits/stdc++.h>
using namespace std;
int main(){
	freopen("hub.in","r",stdin);
	freopen("hub.out","w",stdout);
	cout<<12251;
	return 0;
}

migrate.cpp

C++
#include <bits/stdc++.h>
using namespace std;
int main(){
	freopen("migrate.in","r",stdin);
	freopen("migrate.out","w",stdout);
	cout<<"6800625333\n\
6247500\n\
6242502\n\
4998\n\
9994\n\
0\n\
0\n\
0\n\
2\n\
1\n\
0\n\
2\n\
3\n\
6\n\
0\n\
2\n\
";
	return 0;
}

subway.cpp

代码过长,请手动打开
C++
#include <bits/stdc++.h>
using namespace std;
int main(){
	freopen("subway.in","r",stdin);
	freopen("subway.out","w",stdout); 
	cout<<"341\n\
667\n\
1255\n\
775\n\
558\n\
863\n\
540\n\
250\n\
1088\n\
1225\n\
1257\n\
360\n\
758\n\
703\n\
474\n\
357\n\
791\n\
780\n\
1015\n\
222\n\
212\n\
458\n\
570\n\
1429\n\
1052\n\
263\n\
874\n\
392\n\
1247\n\
1036\n\
426\n\
291\n\
292\n\
1342\n\
1339\n\
267\n\
632\n\
797\n\
232\n\
446\n\
496\n\
638\n\
899\n\
408\n\
914\n\
516\n\
336\n\
963\n\
1181\n\
589\n\
389\n\
178\n\
762\n\
340\n\
974\n\
677\n\
527\n\
281\n\
512\n\
1069\n\
509\n\
653\n\
437\n\
1074\n\
569\n\
1331\n\
236\n\
692\n\
1059\n\
402\n\
1058\n\
241\n\
285\n\
121\n\
422\n\
262\n\
577\n\
593\n\
398\n\
359\n\
506\n\
402\n\
926\n\
510\n\
639\n\
709\n\
329\n\
808\n\
94\n\
1314\n\
329\n\
795\n\
592\n\
391\n\
786\n\
349\n\
576\n\
405\n\
843\n\
464\n\
395\n\
634\n\
601\n\
814\n\
998\n\
1380\n\
1200\n\
985\n\
862\n\
683\n\
304\n\
343\n\
500\n\
538\n\
536\n\
811\n\
722\n\
292\n\
431\n\
368\n\
985\n\
487\n\
277\n\
205\n\
329\n\
1248\n\
837\n\
965\n\
765\n\
707\n\
1047\n\
355\n\
666\n\
565\n\
407\n\
228\n\
690\n\
1175\n\
126\n\
1015\n\
461\n\
235\n\
354\n\
100\n\
758\n\
388\n\
839\n\
574\n\
553\n\
349\n\
330\n\
659\n\
438\n\
352\n\
1347\n\
879\n\
897\n\
266\n\
313\n\
1072\n\
1246\n\
512\n\
285\n\
430\n\
724\n\
965\n\
949\n\
1072\n\
295\n\
475\n\
348\n\
1188\n\
153\n\
171\n\
132\n\
638\n\
664\n\
306\n\
841\n\
1154\n\
831\n\
1072\n\
523\n\
358\n\
608\n\
256\n\
1230\n\
300\n\
617\n\
1342\n\
1500\n\
268\n\
250\n\
280\n\
389\n\
665\n\
624\n\
667\n\
693\n\
297\n\
";
	return 0;
}

AH-S00033:神秘自创语言

crystal.CPP

C++
#include<bits/stdc++.h>
using namespace std;
int n,ma,b,c,d,e;
 cin >>n>>m>>a>>b>>c>>d>>e;
 //for(int i=1;i<=n;i++){
   // }else if{
    // for(int j=1;j<n;j++){
    //   cout<<n
    // }if{
    //  for(int k=1;k<=i;k--){
    //  cout<<k+i-j;
    //  }
    //}
 // }
// main(){
int main(){
   cout<<"4";
   
return 0;
}
// /dfs(a);
// for(int i=i;i<=a;i+a+){
   //}else{
   //for(int j=b;j--){
   //   cout<<a+b+c=d;
    //}

  //  for(int q=1;q<=m;q++){
    // dfs(m){
    //   for(int j=0;j<=i;j++){
     //      cout<<a*c+=m;
    //  while(m);
    //  else if{
      //   j+a==a||a+b+=c;
   //      cout<<a+bt+i;
  //       }if{
 //          j+a==b||a+d+=m;
   //        cout <<a*c+b
  //    dfs()a+b=f+n=1;
      
#include<bits/stdc++.h>
using namespace std;
int n,ma,b,c,d,e;
 cin >>n>>m>>a>>b>>c>>d>>e;
 //for(int i=1;i<=n;i++){
   // }else if{
    // for(int j=1;j<n;j++){
    //   cout<<n
    // }if{
    //  for(int k=1;k<=i;k--){
    //  cout<<k+i-j;
    //  }
    //}
 // }
// main(){
int main(){
   cout<<"4";
   i knowjust we will goinf ;,sub aie ; 
   ()dnuab uaw 
   dmione bain +fimh :
   *- lneib 
   
   i dont' nrrd youleave iam houding no soeri bandin ;
   
return 0;
}
// /dfs(a);
// for(int i=i;i<=a;i+a+){manjdk 
()   gmipamrg ar
   //}else{
   //for(int j=b;j--){
   //   cout<<a+b+c=d;
    //}KALE XIONG DI ,LAK

  //  for(int q=1;q<=m;q++){
    // dfs(m){
    //   for(int j=0;j<=i;j++){
     //      cout<<a*lINc+=m;
    //  while(m);
    //  else if{
      //   j+a==a||a+b+=c;
   //      cout<<a+bt+i;
   //}
   //
   ?}}}}}}}}}}}}
   //pian nide qishi shi duo le ka le xiong di kale,
   w
  //       }if{
 //          j+a==b||a+d+=m;
   //        cout <<a*c+b
  //    dfs()a+b=f+n=1;

hub.cpp

C++
#include<bits/stdc++.h>
using namespace std;
int n,m,b;kal xiongdi kale 
kale ixongdi kale ;
jiab bidawo 
keibei nadji hab po nidesei 
dringk nn ;
 
 inchklsh ()fjk ++foi }f
  ,mio int ugjn ()
  f nubif (){}*
+ab 
()+=dn nf ;;
j++inrn i;fn

int main(){
 ndiona 
 fon kong a++n;
 for9()nint long () [p] m kalxioangdi mam()f]gm kaenhuakal 
    return 0;
    
}
fbvabdnnss ;
;wozhinenghshnsnsh hnnss
akkofnuit() gaklj+ kF;dddhaddanndda;
dadaidiguozhiyubuyuanza
;
xjuonurli for(){}\ mnayajiab

 mne buruqinf l
 nishuoleidi kaka ;
 wo shuohe bi tapata;
 aw 
  hfor dfs() ndi3ding nia dlauadong taiguihua +d() -=
  ]
  ioonhiod kkobf() 
   lakkai huow hchr 
   zhaoraenlai lo ;'
   laiocn g nia kaish ula 
   biernwe
   yaowen jiush i
   cong ni ka 
   w bushi n g
   zhiyouni
    asdjun kaije;
    iCna nlifu with hyou ;
    ek eaik iong 
    r
     
     rtIRerb urb 
     aghea iam shui kfanh;
     abnnag nkao ngn  banck l
     dmangoanel ign ;
     i  
     sdubw hgh 

subway.cpp

C++
#include<bits/stdc++.h>
using namespace std;
int n,ma,b,c,d,e;
 cin >>n>>m>>a>>b>>c>>d>>e;
    for(int q=1;q<=m;q++){
    dfs(m){
      for(int j=0;j<=i;j++){
         cout<<a*c+=m;
    while(m);
 else if{
j+a==a||a+b+=c;
         cout<<a+bt+i;
         }if{
         j+a==b||a+d+=m;
     dfs()a+b=f+n=1;
          for(int q=1;q<=m;q++){
    dfs(m){
      for(int j=0;j<=i;j++){
         cout<<a*c+=m;
    while(m);
 else if{
j+a==a||a+b+=c;
         cout<<zheboak 
         }if{
         j+a==b||a+d+=m;
     dfs()a+b=f+n=1;
          for(int q=1;q<=m;q++){
    dfs(m){
      for(int j=0;j<=i;j++){
         cout<<a*c+=m;
    while(m);
 else if{
j+a==a||a+b+=c;
         cout<<a+bt+i;
         }if{
         j+a==b||a+d+=m;
     dfs()a+b=f+n=1;
          for(int q=1;q<=m;q++){
    dfs(m){
      for(int j=0;j<=i;j++){
         cout<<a*c+=m;
    while(m);
 else if{
j+a==a||a+b+=c;
         cout<<a+bt+i;
         }if{
         j+a==b||a+d+=m;
     dfs()a+b=f+n=1;
          for(int q=1;q<=m;q++){
    dfs(m){
      for(int j=0;j<=i;j++){
         cout<<a*c+=m;
    while(m);
 else if{
j+a==a||a+b+=c;
         cout<<a+bt+i;
         }if{
         j+a==b||a+d+=m;
     dfs()a+b=f+n=1;
      
      #include<bits/stdc++.h>
using namespace std;
int n,ma,b,c,d,e;
 cin >>n>>m>>a>>b>>c>>d>>e;
 //for(int i=1;i<=n;i++){
   // }else if{
    // for(int j=1;fi nti  j<n;j++){inrtnnugiu
    //inchadian an chrnb apib 
    ))finun fbain ;
    
    //   cout<<n
    // }if{
    //  for(int k=1;k<=i;k--){
    //  cout<<k+i-j;
    //  }
    //}
 // }
// main(){intr //

//mistake and mistake 
here is a will,this is way
int main(){
   cout<<"4";
   //f nrn ;
   //tnr
return 0;
}
// /dfs(a);
// for(int i=i;i<=a;i+a+){
   //}else{
   //for(int j=b;j--){
   //   cout<<a+b+c=d;
    //}

  //  for(int q=1;q<=m;q++){
    // dfs(m){
    //   for(int j=0;j<=i;j++){
     //      cout<<a*c+=m;
    //  while(m);
    //  else if{
      //   j+a==a||a+b+=c;
   //      cout<<a+bt+i;
  //       }if{
 //          j+a==b||a+d+=m;
   //        cout <<a*c+b
  //    dfs()a+b=f+n=1;
      

AH-S00038:脏话+输出样例

subway.cpp

C++
#include<bits/stdc++.h>
using namespace std;
int ma[14200][14200],wcnm[14200][14200],a;
int c,n,m,d,q;
queue<int>qq;
set<int>ss;
bool inme(int i){
	int ruioewpq=ss.size();
	ss.insert(i);
	int jalfj=ss.size();
	bool u=!(jalfj-ruioewpq);
	ss.erase(i);
	return u;
	}

int main(){
	
	freopen("subway.in","r",stdin);
	freopen("subway.out","w",stdout);
	cin>>c>>n>>m>>d>>q;
	//cout<<"ready"<<endl;
	for(int i=1;i<=14199;i++){
		for(int j=1;j<=14199;j++){
			ma[i][j]=0x7fffffff;
			wcnm[i][j]=0x7fffffff;
			}
		}
		if(c==0){
			if(m==5)cout<<"32\n17";
			else if(m==7)cout<<"35\n16";
			else if(m==136)cout<<"341\n667\n1255\n775\n558\n863\n540\n250\n1088\n1225\n1257\n360\n758\n703\n474\n357\n791\n780\n1015\n222\n212\n458\n570\n1429\n1052\n263\n874\n392\n1247\n1036\n426\n291\n292\n1342\n1339\n267\n632\n797\n232\n446\n496\n638\n899\n408\n914\n516\n336\n963\n1181\n589\n389\n178\n762\n340\n974\n677\n527\n281\n512\n1069\n509\n653\n437\n1074\n569\n1331\n236\n692\n1059\n402\n1058\n241\n285\n121\n422\n262\n577\n593\n398\n359\n506\n402\n926\n510\n639\n709\n329\n808\n94\n1314\n329\n795\n592\n391\n786\n349\n576\n405\n843\n464\n395\n634\n601\n814\n998\n1380\n1200\n985\n862\n683\n304\n343\n500\n538\n536\n811\n722\n292\n431\n368\n985\n487\n277\n205\n329\n1248\n837\n965\n765\n707\n1047\n355\n666\n565\n407\n228\n690\n1175\n126\n1015\n461\n235\n354\n100\n758\n388\n839\n574\n553\n349\n330\n659\n438\n352\n1347\n879\n897\n266\n313\n1072\n1246\n512\n285\n430\n724\n965\n949\n1072\n295\n475\n348\n1188\n153\n171\n132\n638\n664\n306\n841\n1154\n831\n1072\n523\n358\n608\n256\n1230\n300\n617\n1342\n1500\n268\n250\n280\n389\n665\n624\n667\n693\n297\n";
			return 0;
			}
	for(int i=1;i<=m;i++){
		cin>>a;
		ma[(i-1)*d][(i-1)*d+1]=a;
		ma[(i-1)*d+1][(i-1)*d]=a;
		ma[(i-1)*d][(i-1)*d]=-1;
		ma[(i-1)*d+1][(i-1)*d+1]=-1;
		}
	for(int i=1;i<=n;i++){
		int k;
		cin>>k;
		int afnum=0;
		for(int j=1;j<=k;j++){
			int zhtai,t;
			cin>>zhtai>>t;
			ma[(zhtai-1)*d+1+i][(zhtai-1)*d+1]=t;
			ma[(zhtai-1)*d+1][(zhtai-1)*d+1+i]=t;
			ma[(zhtai-1)*d+1+i][(zhtai-1)*d+1+i]=-1;
			ma[(zhtai-1)*d+1][(zhtai-1)*d+1]=-1;
			//cout<<"ready!!"<<endl;
			if(j==1){
				afnum=zhtai;
				continue;
				}
				
				
				//cout<<(zhtai-1)*d+1+i<<' '<<(afnum-1)*d+1+i<<endl;
				ma[(zhtai-1)*d+1+i][(afnum-1)*d+1+i]=0;
				ma[(afnum-1)*d+1+i][(zhtai-1)*d+1+i]=0;
				ma[(zhtai-1)*d+1+i][(zhtai-1)*d+1+i]=-1;
				ma[(afnum-1)*d+1+i][(afnum-1)*d+1+i]=-1;
				
				//cout<<"r!"<<endl;
				afnum=zhtai;
				
				
				
			}
		}
		
		
		
		
		
		
		for(int i=1;i<=14199;i++){
		for(int j=1;j<=14199;j++){
			wcnm[i][j]=ma[i][j];
			}
		}
		
		for(int i=1;i<=14199;i++){
			if(ma[i][i]==-1){
				continue;
				}
				
				qq.push(i);
	while(!qq.empty()){
		int now=qq.front();
		ss.insert(now);
		qq.pop();
		for(int da=1;da<=m*(d+2);da++){
			if(inme(da)||ma[now][da]==0x7fffffff){
				break;
				}
				qq.push(i);
				if(wcnm[i][da]>wcnm[i][now]+ma[now][da])wcnm[i][da]=wcnm[i][now]+ma[now][da],wcnm[da][i]=wcnm[i][now]+ma[now][da];
				
			}
		
		}
			}
		for(int i=1;i<=q;i++){
		int st,en;
		cin>>st>>en;
		cout<<wcnm[st][en]<<endl;
		}
		
	return 0;
}

AH-S00046:洛谷号A_as

C++
#include<bits/stdc++.h>
using namespace std;//luogunameA_as
const int N=1e4+1;
int w[N];
vector<pair<int,int>> subhave[N];//time,lineuid
struct node{
	int k;
	vector<pair<int,int>> sub;//subuid,time
};
long long ti[N][N];
//bool const operator()(const pair<int,int> x,const pair<int,int>y){
//	return x.first>y.first;
//}
node line[501];
/*auto*/int read(){
	char c=getchar_unlocked();
	/*auto*/int sum=0;
	int f=1;
	while(c>'9'||c<'0'){
		if(c=='-') f=-1;
		c=getchar_unlocked();
	}
	while(c>='0'&&c<='9'){
		sum*=10;
		sum+=c-'0';
		c=getchar_unlocked();
	}
	return sum*f;
}
void write(/*auto*/int sum){
	int s=-1;
	char c[20];
	if(sum<0){
		sum=-sum;
		putchar_unlocked('-');
	}
	if(sum==0){
		putchar_unlocked('0');
		return ;
	}
	while(sum!=0){
		c[++s]=sum%10+'0';
		sum/=10;
	}
	for(int i=s;i>=0;i--) putchar_unlocked(c[i]);
}
int main(){/* the first idea:dijkstra(priority_queue),n^2logn,emm...I forget  how to write the third priority*/
	freopen("subway.in","r",stdin);
	freopen("subway.out","w",stdout);
	int c=read(),n=read(),m=read(),d=read(),q=read();
	for(int i=1;i<=m;i++){
		w[i]=read();
		for(int j=1;j<=m;j++){
			ti[i][j]=INT_MAX;
		}
	}
	for(int i=1;i<=n;i++){
		 line[i].k=read();
		 for(int j=1;j<=line[i].k;j++){
			int aya=read();
			int kkk=read();
			subhave[aya].push_back({kkk,i});
			line[i].sub.push_back({aya,kkk});
		 }
	}
	// begin to dijkstra
	for(int i=1;i<=m;i++){
		queue<pair<int,int>> qp;
		qp.push({i,0});
		ti[i][i]=0;
		for(int j=i-1;j>=1;j--){
			qp.push({j,ti[i][j]});
		}
		while(!qp.empty()){
			auto qq=qp.front();
			qp.pop();
			if(ti[i][qq.first]<qq.second&&qq.first!=i) continue;
			for(auto v:subhave[qq.first]){
				for(auto val:line[v.second].sub){
					if(val.first<=i) continue;
					if(ti[i][val.first]>ti[i][qq.first]+v.first+val.second){
						ti[val.first][i]=ti[i][val.first]=ti[i][qq.first]+v.first+val.second;
						qp.push({val.first,ti[i][val.first]});
					}
				}
			}
		}
	}
	while(q--){
		int from=read();
		int to=read();
		write(ti[from][to]+w[from]+w[to]);
		putchar_unlocked('\n');
	}
	return 0;
}

AH-S00057:细节人,恶臭人

该人代码内78,91,13,114514,1919810成分较多

crystal.cpp

C++
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m,a[789113],he=0,ans=0;
int main(){
    freopen("crystal.in","r",stdin);
    freopen("crystal.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin>>n>>m;
    for(ll i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    for(ll cnt=0;cnt<m;cnt++){
        for(ll i=n-1;i>0;i--){
            he=0;
            for(ll j=0;j<i;j++){
                he+=(a[i]-a[j]);
            }
            if(he<=m) ans=max(ans,i+1);
        }
    }
    cout<<ans;
    return 0;
}

migrate.cpp

C++
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll c,t,n,a[789113],ans=0,vis[789113],d,dirmn=0x3f3f3f3f3f3f3f3f,dir,cnt;
vector<ll> vec[789113];
stack<ll> st;
struct node{
    ll x,d;
};
ll bfs(ll u,ll v){
    memset(vis,0,sizeof(vis));
    queue<node> q;
    q.push({u,0});
    while(!q.empty()){
        node now=q.front();
        q.pop();
        if(now.x==v) return now.d;
        for(ll i=0;i<vec[now.x].size();i++){
            if(vis[vec[now.x][i]]==0){
                vis[vec[now.x][i]]=1;
                q.push({vec[now.x][i],now.d+1});
            }
        }
    }
    return -114514;
}
void dfs(ll u,ll v){
    if(u==v){
        vis[v]=0;
        st.push(dir);
        return;
    }
    for(ll i=0;i<vec[u].size();i++){
        if(vis[vec[u][i]]==0){
            vis[vec[u][i]]=1;
            dir++;
            dfs(vis[vec[u][i]],v);
            dir--;
            vis[vec[u][i]]=0;
        }
    }
    return;
}
int main(){
    freopen("migrate.in","r",stdin);
    freopen("migrate.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>c>>t;
    while(t--){
        memset(vis,0,sizeof(vis));
        cin>>n>>d;
        for(ll i=0;i<n;i++){
            cin>>a[i];
        }
        for(ll i=0;i<n;i++){
            for(ll j=i+1;j<n;j++){
                if(a[j]-a[i]<=d) vec[i].push_back(j);
            }
        }
        for(ll i=0;i<n;i++){
            for(ll j=i+1;j<n;j++){
                dfs(i,j);
                while(!st.empty()){
                    if(st.top()==bfs(i,j)) ans++;
                    st.pop();
                }
                if(ans==2) cnt++;
                ans=0;
            }
        }
        cout<<cnt<<"\n";
        cnt=0;
        for(ll i=0;i<n;i++){
            for(ll k=0;k<vec[i].size();k++){
                vec[i].pop_back();
            }
        }
    }
    return 0;
}

subway.cpp

C++
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll c,m,n,d,q,a[1378][1378],k[1378],t[1378][1378],w[1378],r,l,mn;
int main(){
    freopen("subway.in","r",stdin);
    freopen("subway.out","w",stdout);
    cin>>c>>n>>m>>d>>q;
    for(ll i=0;i<m;i++){
        cin>>w[i];
    }
    for(ll i=0;i<n;i++){
        cin>>k[i];
        for(ll j=0;j<k[i];j++){
            cin>>a[i][j]>>t[i][j];
        }
    }
    for(ll i=0;i<q;i++){
        cin>>l>>r;
        ll he=0;
        he+=(w[l]+w[r]);
        mn=11451419198101145;
        for(ll p=0;p<n;p++){
            for(ll j=1;j<2*k[p];j+=2){
                mn=min(mn,a[p][j]);
            }
            he+=mn;
        }
        cout<<he<<"\n";
    }
    return 0;
}

AH-S00059:骗分

hub.cpp

C++
#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("hub.in","r",stdin);
	freopen("hub.out","w",stdout);
	cout<<"1"<<endl<<"2";
	return 0;
}

migrate.cpp

C++
#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("migrate.in","r",stdin);
	freopen("migrate.out","w",stdout);
	cout<<"0"<<endl<<"1";
	return 0;
}

subway.cpp

C++
#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("subway.in","r",stdin);
	freopen("subway.out","w",stdout);
	cout<<"35"<<endl<<"16";
	return 0;
}

AH-S00093:祝99

C++
#include<bits/stdc++.h>
using namespace std;
const int N=2e6+10;
int a[N];
long long RP=0;
#define INF 11936520
#define xzr 20110420
int read(){
	int s=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-')f=-1;
		ch=getchar();
	}
	while(isdigit(ch)){
		s=(s<<3)+(s<<1)+ch-'0';
		ch=getchar();
	}
	return s*f;
}
inline void write(int x){
	if(x<0)putchar('-'),x=-x;
	if(x>9)write(x/10);
	putchar(x%10+'0');
}
int main(){
	freopen("migrate.in","r",stdin);
	freopen("migrate.out","w",stdout);
	int c=read(),t=read();
	RP+=INF;
	if(c>=11&&c<=12){
		while(t--){
			int n=read(),d=read();
			memset(a,0,sizeof(a));
			for(int i=1;i<=n;i++)a[i]=read();
			int del=a[2]-a[1];
			int tmp=1;
			for(int i=1;i<=n;i++){
				if(i*del<=d)tmp=i;
				else break;
			}
			if(del>=d)cout<<0<<endl;
			else cout<<(n-1)*(n-2)/2<<endl;
		}
	}else
	{
		while(t--){
			cout<<0<<endl;
		}
	}
	//徐子冉520 jr99
	return 0;
}