CSP2024 SD 赛区 迷惑行为大赏

· · 休闲·娱乐

S 组

信息统计

本次 CSP 共 1424 人参赛,外加五个 JS 的也在 SD 压缩包里(?)

题目 有 freopen 人数 占比*
A 1422 99.51\%
B 1394 97.55\%
C 1293 90.48\%
D 958 67.04\%

*:算上了 5 个 JS 的。

抽象行为

//freopen75 个文件里出现了 3062 次(神金)。

15 份文件里有 20luogu,其中大部分留下的是自己的 uid。

genshin11 个文件中出现 52 次,大家一定都很喜欢玩原神(

ccf26 份文件中出现了 32 次,下面节选一下:

SD-S00191

// 你说得对 但是 YHB(T_TLucas_Yin, luogu uid=835809) 是一班班花, txdy 可爱 

甚至有我的 uid:

int calc(int v1, int a1, int p) {
    int root = v1*v1 + 2*a1*p;
    if (root < 0) {
        return -761125; // -1;
    }
    return root;
}

一看就知道是某个 uid378467 的人写的

SD-S00322

// @ hm2ns 
// may get 60 pts
// ccf is great! it gives me a hack!

SD-S01181

// Help me , CCF !

SD-S01252

//const int INF=0x66ccff;

不知道是不是和去年普及那位写 0x66ccff 的是一个人(

SD-S00535

#include <bits/stdc++.h>

#define int long long

using namespace std;

const int N = 1e6 + 5;

signed main() {
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    puts("1");  // Our biology teacher is the most beautiful. 
    return 0;
} 

//不会了,不会人生就这样了吧! 
//白衣少女永远活在我们的心中,虽然她并没有死! 
//不要啊! 
//我想得到的一切,只要不与智商有关,基本都得不到(与智商有关也不一定能得到)。 
//智商低,情商低,且颜值低,能成何事? 
//唯有将后两者填入前者,才可成才! 
//记住,实力决定一切。 
//没有实力,一切都是徒有虚名。
//奋斗吧,你还有希望,你并不是无路可走。 
//抓住每一次机会,不要成为时代的眼泪。 
//天上没有那么多砸入你家的陨石,脚踏实地的走下去,才是正道。
//与其费力搞到白衣少女,不如自己创造一个白衣少女!
//白衣少女在二分图上被所有人连边,而你可以创造出一个自己首先连边且最早匹配且你心无旁骛的白衣少女! 

SD-S00492

// I love Chtholly forever.

SD-S00824

/*
Dear problem-creator,
    I love you. Even if I hope your
    m is healthy, you'll lose her.
                        Yours.
                        Li Yua
*/

SD-S01150 的所有代码的命名方式都是 准考证号+名字.cpp

SD-S01186

#include<bits/stdc++.h>
using namespace std;
//#define nhd cerr<<"I_LOVE_NAHIDA"<<endl;

SD-S00294

荣获 arena 代码长度第一,这是他的代码:

#include<bits/stdc++.h>
using namespace std;

int mian(){

    //freopen("arena.in","r",stdin);
    //freopen("arena.out","w",stdout);
    //freopen("arena.in","r",stdin);
    //freopen("arena.out","w",stdout);
    //freopen("arena.in","r",stdin);
    //freopen("arena.out","w",stdout);
    //freopen("arena.in","r",stdin);

  ......(这人代码有 2000 多个 freopen)

  //freopen("arena.in","w",stdin);
    //freopen("arena.out","r",stdout);
    //freopen("arena.out","r",stdin);
    //freopen("arena.in","w",stdout);
    printf("5\n19\n7\n1");
    return 51971;
}               

最长代码

SD-S1016

荣获 color 代码长度第一,这是他的代码:

*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
 1 1 1 1 2 1 2 2 2 1 2 2 2 2 1 1 2 2 2 2 1 2 2 1 1 2 1 2 2 2 2 2 2 1 2 2 2 2 2 1 1 1 1 1 2 2 2 2 1 2 1 1 2 1 2 1 2 2 2 2 2 2 1 1 2 2 1 1 1 2 1 1 2 1 1 2 2 2 1 1 2 2 2 1 1 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 2 2 1 2 1 2 1 1 2 2 2 1 2 1 2 1 2 2 1 1 2 1 2 2 2 2 2 2 1 2 2 2 1 2 2 1 1 2 1 2 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 1 1 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 1 2 2 1 2 1 2 2 2 1 1 2 1 1 2 2 1 2 2 2 1 2 1 2 1 2 2 2 1 2 2 1 2 2 1 2 2 1 1 1 1 2 1 2 2 2 2 1 2 1 2 2 2 1 1 1 2 2 2 1 2 2 2 2 2 2 1 2 2 1 2 2 2 1 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 1 2 2 2 1 1 2 2 1 2 1 1 2 2 2 1 2 1 2 1 2 1
 (后略)

SD-S00939

detect 最长代码(6.4k),而且居然有意义!

//#pragma GCC optimize (2)
#include <bits/stdc++.h>
//#include <windows.h>

using namespace std;

/* --------------- fast io --------------- */

(快读略,占了 100 行)

#define cin Fastio :: cin
#define cout Fastio :: cout
#define endl Fastio :: endl
/* --------------- fast io --------------- */ // end

#define ll long long
#define int long long
#define mid (l + r >> 1)
#define lowbit(x) (x & -x)

const int N = 1e5 + 5;

int T, n, m, l, s, tmp;
int sub[N];
int f[N], g[N];
struct Car {
    int d, v, a;
    int cnt, l, r;
    bool flag;

    bool operator < (const Car& t) const {
        if (flag != t.flag) return flag > t.flag;
        return r < t.r;
    }
};
Car c[N];
priority_queue <int> q;

void init() {
    for (int i = 0; i <= m + 1; ++i) sub[i] = 0;
    for (int i = 0; i <= n + 1; ++i) {
        c[i].d = c[i].v = c[i].a = 0;
        c[i].cnt = c[i].l = c[i].r = 0;
        c[i].flag = false;
    }
    while (!q.empty()) {
        q.pop();
    }
}

bool check(int i, int tmp) {
    // check if car k can't pass machine tmp
    if (sub[tmp] < c[i].d || sub[tmp] > c[i].cnt) return false;
    if (s * s >= c[i].v * c[i].v + 2ll * c[i].a * (sub[tmp] - c[i].d)) return false;
    return true;
}

int find1(int i) {
    int l = 1, r = m;
    while (l < r) {
        if (sub[mid] < c[i].d) l = mid + 1;
        else r = mid;
//      cerr << "find1\n";
    }
    if (check(i, l)) return l;
    else return m + 1;
}

int find2(int i) {
    int l = 1, r = m;
    while (l < r) {
        if (check(i, mid)) r = mid;
        else l = mid + 1;
//      cerr << "find2\n";
    }
    if (check(i, l)) return l;
    else return m + 1;
}

int find3(int i) {
    if (c[i].l == m + 1) return m + 1;

    int l = c[i].l, r = m;
    while (l < r) {
        if (check(i, mid)) l = mid + 1;
        else r = mid;
//      cerr << "find3\n";
    }
    if (l > c[i].l && !check(i, l)) --l;
    if (check(i, l)) return l;
    else return m + 1;
}

int get(int k) {
    int l = 1, r = tmp;
    while (l < r) {
        if (c[mid].r < k) l = mid + 1;
        else r = mid;
    }
    if (l > 1) --l;
    if (c[l].r >= k) return 0;
    return c[l].r;
}

void Solve() {
    int tmp1 = -2;
    for (int i = 1; i <= n; ++i) {
        if (c[i].a >= 0) c[i].cnt = l;
        else c[i].cnt = min(l, c[i].d + (c[i].v * c[i].v) / (tmp1 * c[i].a));
    }

//  sort(sub + 1, sub + m + 1);

    int ans1 = 0;
    for (int i = 1; i <= n; ++i) {
        if (c[i].a == 0) {
            c[i].l = find1(i);
            c[i].r = (c[i].l <= m ? m : m + 1);
        } else if (c[i].a > 0) {
            c[i].l = find2(i);
            c[i].r = (c[i].l <= m ? m : m + 1);
        } else {
            c[i].l = find1(i);
            c[i].r = find3(i);
        }

        if (c[i].l <= m && c[i].r <= m) {
            ++ans1;
            c[i].flag = true;
        }

//      cerr << "c[" << i << "].l = " << c[i].l << " ";
//      cerr << "c[" << i << "].r = " << c[i].r << "\n";
    }

//  for (int i = 1; i <= n; ++i) cerr << c[i].l << " " << c[i].r << endl;

    cout << ans1 << " ";

    /* -------------------------------------------------- */

    tmp = n;
    int ans2 = 0;
    sort(c + 1, c + n + 1);

    for (int i = 1; i <= n; ++i) {
        if (c[i].flag == false) {
            tmp = i - 1;
            break;
        }
    }

    if (tmp == 0) {
        cout << m << "\n";
        return ;
    }

    for (int i = 1; i <= m; ++i) {
        g[i] = get(i);
    }

//  for (int i = 1; i <= tmp; ++i) cerr << c[i].l << " " << c[i].r << endl;
//  for (int i = 1; i <= m; ++i) cerr << g[i] << " ";
//  cerr << "\nqwq\n";

    memset(f, 0x3f, sizeof(f));
    f[0] = 0;
    for (int i = 1; i <= tmp; ++i) {
        q.push(c[i].l);
        while (i <= tmp && c[i + 1].r == c[i].r) q.push(c[++i].l);
        f[c[i].r] = min(f[c[i].r], f[g[q.top()]] + 1);
    }

    for (int i = m; i > 0; --i) {
        if (f[i] < f[m + 2]) {
            ans2 = f[i];
            break;
        }
    }

//  for (int i = 1; i <= m; ++i) cerr << f[i] << " ";
//  cerr << "\nawa\n";

    cout << m - ans2 << endl;
}

signed main() {
    freopen("detect.in", "r", stdin);
    freopen("detect.out", "w", stdout);

    cin >> T;
    while (T--) {
        cin >> n >> m >> l >> s;
        for (int i = 1; i <= n; ++i) cin >> c[i].d >> c[i].v >> c[i].a;
        for (int i = 1; i <= m; ++i) cin >> sub[i];

        Solve();

        init();
    }

    return 0;
}
/*
1
10 10 69458 227
41471 989 -41
54266 987 -6
65335 774 -29
5337 999 -10
60091 567 -12
52229 845 -42
4754 810 -5
6632 637 -2
46771 771 -375
52434 992 -79
9324 36862 44559 51022 52755 53293 60089 60120 63342 69458
*/

duel 的最长代码也是这位老哥的,不知道他这个巨大的快读是哪里来的(

J 组

信息统计

本次 CSP 共 2265 人参赛,外加两个 JS 的也在 SD 压缩包里(?)

题目 有 freopen 人数 占比*
A 2253 99.38\%
B 2217 97.79\%
C 2143 94.53\%
D 1833 80.86\%

*:算上了 2 个 JS 的。

抽象行为

//freopen106 个文件里出现了 190 次(还是太保守了)。

21 个人 stick 没变复数,这启示我们要学好英语。

23 个人万能头斜杠打反了,默哀。

笑点解析:没有人代码里有 genshin

SD-J01121

一段只有 ssfz 项目部 2026 级一班能看懂的文字:

/*
UJU JJT
TJUTUXU JUUTurn Chou'Fu U.
TUJUReturnTU UTU UJUUReturnUJ.
UBUTJRMm USm(S Mn)UJUJ.
JUJFTZJ FUJ TJoeJJSsJ!
GD TW SX
ETJ ETJ 30'sHW==B+
900Hiszy=a+-2
1leaD2cr0wd
zyz,??,WDC F. de F..
WDCl0g0::ETJ.png;Winter KJean
AgCuAu==231==bythzy/
1:gd,2:Y,
1:gd=D!2:Y!
1:gd!!2.eue!!
1:tw!2.T!
1:tw!!2.T!!
1.tw!!!2.trrrrrn!!!
1.sx!!2.J!!
1:sx!!!2.J!!!
1.sx!!!!2.jjjjeeeeeeeeeen!!!!
1.~!!!2.

@@@@@@  @@@@@@  @@@@@@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@
@@        @@        @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  
@@@@@@    @@        @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@ 
@@        @@    @@  @@ 
@@@@@@    @@     @@@@   @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  @@  

*/

SD-J00236

#include<bits/stdc++.h>
using namespace std;
set<string> st;
int n;
int main(){
    freopen("joker.in","r",stdin);
    freopen("joker.out","w",stdout);
    cin>>n;
    char s[5];
    for(int i = 1;i<=n;i++){
        cin>>s[1]>>s[2];
        string s1;
        s1 += s[1];
        s1 += s[2];
        st.insert(s1);
    }
    cout<<52-st.size();
} 

SD-J00923

freopen("explorer.in","r",stdin);
freopen("explorer.out","w",stdout);

SD-J01097

是世末歌者哎!

#include<bits/stdc++.h>
using namespace std;
int n,cnt;
int a[55][55];
int main(){
    freopen("poker.in","r",stdin);
    freopen("poker.out","w",stdout);
    //关注luogu uid1223290 liyuanxi_0214喵! 
    //GL@17SXYZ Y#C*GF@24 114514 1919810
    //蝉时雨 化成淡墨渲染暮色
    //渗透着 勾勒出足迹与车辙
    //欢笑声 与漂浮的水汽饱和
    //隔着窗 同城市一并模糊了 
    cin>>n;
(后略)
freopen("explore.in","r",stdin);
    freopen("explore.out","w",stdout);
    //I love CCF 
    //拨弄着 旧吉他 哼着四拍子的歌
    //回忆中 一个人 仿佛颇悠然自得
    //等凉雨 的温度 将不安燥热中和
    //寻觅着 风的波折 
    scanf("%d",&T);
(后略)
freopen("sticks.in","r",stdin);
    freopen("sticks.out","w",stdout);
    //我依然在 无人问津的阴雨霉湿之地
    //和着雨音 唱着没有听众的歌曲
    //人潮依然 漫无目的地向目的地散去
    //忙碌着 无为着 继续 
freopen("chain.in","r",stdin);
    freopen("chain.out","w",stdout);
    //人们终于 结束了呆滞恐惧伫立原地
    //哭泣着 乞求着 奇迹 
    //请别让我 独自匍匐于滂沱世末之雨
    //即使是你 也仅仅驻足了片刻便离去
    //曲终之时 你是否便会聆听我的心音
    //将颤抖的双手牵起 

怎么还错了两句

SD-J01312

#include<bits/stdc++.h> 
using namespace std;
int main(){
    freopen(".in",'r',stdin);
    freopen(".out",'w',stdout);
    int t
    cin>>t;
    for(int i=0;i<t;i++){
        cout<<1;
    }
    freclose(stdin);
    freclose(stdout);   
    return 0;
}

最长代码

SD-J00343 的 T1 写了 5 KB(遗憾的是 freopen 写错了),这是他的代码节选:

#include<iostream>
#define ll long long
using namespace std;
struct AK{
    int ag;
    int g2;
    int g3;
    int g4;
    int g5;
    int g6;
    int g7;
    int g8;
    int g9;
    int tg;
    int jg;
    int qg;
    int kg;
};
AK D,C,H,S;
ll sum=52;
int main()
{
    freopen("poker","r",stdin);
    freopen("poker","w",stdout);
    ll n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        char a[1010];
        cin>>a[1];
        cin>>a[2];
        if(a[1]=='D')
        {
            if(a[2]=='A')
            {
                if(D.ag==0)
                {
                    sum--;
                    D.ag++;
                }
            }
            if(a[2]=='2')
            {
                if(D.g2==0)
                {
                    sum--;
                    D.g2++;
                }
            }
            if(a[2]=='3')
            {
                if(D.g3==0)
                {
                    sum--;
                    D.g3++;
                }
            }
            if(a[2]=='4')
            {
                if(D.g4==0)
                {
                    sum--;
                    D.g4++; 
                }
            }
            if(a[2]=='5')
            {
                if(D.g5==0)
                {
                    sum--;
                    D.g5++;
                }
            }

(中间略,他分类讨论了所有的情况)

            if(a[2]=='Q')
            {
                if(S.qg==0)
                {
                    sum--;
                    S.qg++;
                }
            }
            if(a[2]=='K')
            {
                if(S.kg==0)
                {
                    sum--;
                    S.kg++;
                }
            }
        }
    }
    cout<<sum<<endl;
    return 0;
}

SD-J01019 的 T2 写了 9.98 MB,原因是他复制了大样例到代码。

SD-J02044 的 T3 写了 300 KB,原因是他打了一个 10^5 的表。

SD-J01250 的 T4 写了 104 KB,原因是他打了一大堆无意义的字符。

(感觉还是太神金了)

欢迎大家补充 qwq。