JX NOIP (2020) 迷惑行为大赏

· · 休闲·娱乐

统计时使用的代码从这里魔改而来。

还有其他的可以投过来。

JX 源码

1.一些统计

(根据我们教练)应考 134 人,实考 125 人,然而收上的程序中准考证号只到 133。

JX 的选手们一共写出了 6791 个 int,583 个 long long,1129 个 include,787 个 freopen

一共有 416 份有效代码,这意味着至少 23 份有效代码文件错误。

2.有关文件

可能有小伙伴要问了,为什么 freopen 的个数是奇数呢?

这里,我们默哀一下 Inf_Voltage 同志:

int main(){
    freopen("string.in","r",stdin);
    froepen("string.out","w",stdout);
    int T;scanf("%d",&T);
    while(T--)solve();
    return 0;
}

而且这是所有代码中唯一一个 froepen(悲)

===== Successfully open the file   answers\JX-0066\water\water.cpp.The size of it is 1.511 KB.
......
int main(){
    freopen("r","water.in",stdin);
    freopen("w","water.out",stdout);
    ......
}

这位选手只写了 water,string 和 walk,但是都这么写错了文件(悲)

搜索 freopen(" 的结果比 freopen( 少 24 个,但这是因为:

freopen(Fname ".in","r",stdin);x8

{ freopen(#X".in", "rb", stdin); freopen(#X".out", "wb", stdout); }x4

freopen(#a".in","r",stdin);freopen(#a".out","w",stdout)x4

所以并没有 freopen(stdin,...) 惨案。

===== Successfully open the file     answers\JX-0095\walk\walk.cpp.The size of it is 4.531 KB.
......
int main(){
    //freopen("walk.in","r",stdin);
    //freopen("walk.out","w",stdout);
    ......
}

这位同学凭借坚强的毅力写出了 4.5KB 的大爆搜,可惜他注释了 freopen。

===== Successfully open the file     answers\JX-0133\ball\ball.cpp.The size of it is 2.493 KB.
......
int main()
{
    //freopen("ball.in","r",stdin);
    //freopen("ball.out","w",stdout);
    int n,m;
    n=read();m=read();
    for(int i=1;i<=n;++i)
        for(int j=1;j<=m;++j)
            a[i][j]=read();
    if(n==2&&m==3&&a[1][1]==1&&a[1][2]==1&&a[1][3]==1&&a[2][1]==2&&a[2][2]==1&&a[2][3]==2)
    {
        cout<<6<<endl;
        cout<<1<<" "<<3<<endl;
        cout<<2<<" "<<3<<endl;
        cout<<2<<" "<<3<<endl;
        cout<<3<<" "<<1<<endl;
        cout<<3<<" "<<2<<endl;
        cout<<3<<" "<<2<<endl;
    }
    if(n==2&&m==20)
    {
    cout<<71<<endl; 
    ......

    }
    return 0;
}

这位同学打出了极大的表,可是这并没有什么用,而且他还注释了 freopen。

3.有关代码长度

超过 10KB 的代码只有两份,如下。

rank= 132,ID=  43,total size=  54.310 KB.
The size of water  is    0.960 KB.
The size of string is   51.771 KB.
The size of ball   is    1.306 KB.
The size of walk   is    0.273 KB.

rank= 133,ID=  58,total size= 165.250 KB.
The size of water  is    1.137 KB.
The size of string is    0.198 KB.
The size of ball   is  162.651 KB.
The size of walk   is    1.264 KB.

我们来看看这两位码农都写了什么:

===== The file     answers\JX-0058\ball\ball.cpp is too big!The size of it is 162.651 KB.
/* 
 * It is strictly recommended to include "testlib.h" before any other include 
 * in your code. In this case testlib overrides compiler specific "random()".
 *
 * If you can't compile your code and compiler outputs something about 
 * ambiguous call of "random_shuffle", "rand" or "srand" it means that 
 * you shouldn't use them. Use "shuffle", and "rnd.next()" instead of them
 * because these calls produce stable result for any C++ compiler. Read 
 * sample generator sources for clarification.
 *
 * Please read the documentation for class "random_t" and use "rnd" instance in
 * generators. Probably, these sample calls will be usefull for you:
 *              rnd.next(); rnd.next(100); rnd.next(1, 2); 
 *              rnd.next(3.14); rnd.next("[a-z]{1,100}").
 *
 * Also read about wnext() to generate off-center random distribution.
 *
 * See https://github.com/MikeMirzayanov/testlib/ to get latest version or bug tracker.
 */

#ifndef _TESTLIB_H_
#define _TESTLIB_H_

/*
 * Copyright (c) 2005-2020
 */

#define VERSION "0.9.34-SNAPSHOT"

/* 
 * Mike Mirzayanov
 *
 * This material is provided "as is", with absolutely no warranty expressed
 * or implied. Any use is at your own risk.
 *
 * Permission to use or copy this software for any purpose is hereby granted 
 * without fee, provided the above notices are retained on all copies.
 * Permission to modify the code and to distribute modified code is granted,
 * provided the above notices are retained, and a notice that the code was
 * modified is included with the above copyright notice.
 *
 */

/* NOTE: This file contains testlib library for C++.
 *
 *   Check, using testlib running format:
 *     check.exe <Input_File> <Output_File> <Answer_File> [<Result_File> [-appes]],
 *   If result file is specified it will contain results.

这位同志的代码就是把 testlib.h 复制了一遍,可谓勇士。

===== The file answers\JX-0043\string\string.cpp is too big!The size of it is 51.771 KB.
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
using namespace std;
int t, len;
string a;
int main()
{
    freopen("string.in", "r", stdin);
    freopen("string.out", "w", stdout);
    cin >> t;
    cin >> a;
    if (t == 3)
    {
        printf("8\n9\n16");
        return 0;
    }
    if (t == 5 && a == "kkkkkkkkkkkkkkkkkkkk")
    {
        printf("156\n138\n138\n147\n194");
        return 0;
    }
    if (t == 5 && a == "owtowtowtymejyevijvpyjuzichichichichichichichichichichichichi......
    ......
    cout << "榈烽洀浜猴紝榈烽洀榄傦紝闃撮槼鎬皵浜轰笂浜恒€? << endl << endl;
    cout << "Asuna" << endl;
    cout << "Angelina" << endl;
    cout << "淇濅綉鎴? << endl;
    return 0;
}

这位同志就是特判了所有样例,然后因最大的样例达到了 50KB。最后的中文乱码了,这输出的啥啊 /yun

小于 100B 的代码共有两份。我们看看他们都写了什么:

===== Successfully open the file     answers\JX-0130\walk\walk.cpp.The size of it is 0.086 KB.
#include<bits/stdc++.h>
using namespace std;

int main()
{
    cout<<"21\n";
    return 0;
}

输出了样例……

===== Successfully open the file     answers\JX-0014\ball\ball.cpp.The size of it is 0.018 KB.
#include<iostream>

没想到吧,我只有一个头文件!

4.搜索关键字

ccf

===== Successfully open the file   answers\JX-0112\water\water.cpp.The size of it is 1.637 KB.
......
int main()
{
    freopen("water.in","r",stdin);
    freopen("water.out","w",stdout);
    cin >> n >> m;//1 to m in
    /*for(int i=1;i<=n;i++){
    cin >> d;
    if(d==0) {ot[++cnt]=i;continue;}
    for(int j=1;j<=d;j++) {int fuckccf;cin >> fuckccf;/*K[i].push_back(fuckccf); cout << fuckccf << ' ';}
    //cin >> ppp;
    //for(int j=1;j<=d;j++) cin >> ppp;
    t[i][1]=1;
    t[i][0]=0;
    cout << endl;
    }*/
    for(int i=1;i<=n;i++){
    cin >> d;
    if(d==0) ot[++cnt]=i;
    for(int j=1;j<=d;j++) {int fuckccf;cin >> fuckccf;K[i].push_back(fuckccf);}
    t[i][1]=1;
    t[i][0]=0;
    //cout << i << ' ';
    }
    for(int i=1;i<=m;i++) t[i][0]=t[i][1]=1;
        for(int i=1;i<=m;i++) spread(i);
    for(int i=1;i<=cnt;i++) cout << t[ot[i]][0] << ' ' << t[ot[i]][1] << endl; 
    return 0; 
}

这是 JX 唯一一位勇于侵犯知识产权的勇士。

fu*k

===== Successfully open the file   answers\JX-0008\water\water.cpp.The size of it is 1.799 KB.
#include<bits/stdc++.h>
......
void fuckget(int  now){
......

口吐芬芳人。

===== Successfully open the file answers\JX-0054\string\string.cpp.The size of it is 1.424 KB.
......
//int h[500010];
//int g[500010];fucking wrong
......
//          g[fa]++;//giaoshit error
        }
//      for(int i=1;i<=l;i++)
//          h[i]=h[i-1]+g[i];//fucking error
......
                    if(fa[k]/*no_f*ck but fa_k hahaha*/>F)continue;
......
//              ans+=h[F];//A:O(1) but fucking wrong;
......
        //what the f*ck it spends time just like O(n^2) ?
        //thank you for your giving points to me.
        //no thanks......
    }
    return 0;
}

这位同学多次在代码内对自己口吐芬芳。

===== Successfully open the file answers\JX-0069\string\string.cpp.The size of it is 0.435 KB.
......
void add(int fuck,int shirt){
  printf("老子不会");

}

过于直接。但他为什么拼错了 sh*t

IOI

===== Successfully open the file   answers\JX-0055\water\water.cpp.The size of it is 1.626 KB.
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
using namespace std;
//Who are you?
//I ak IOI!!! You SUCK!!!
......

AKIOI 的勇士,受我一拜。

upd:这是 LHQing,看来 url 是对的 /cy

===== Successfully open the file     answers\JX-0083\ball\ball.cpp.The size of it is 2.483 KB.
......
inline bool mv(int pos, int to, int YZ_AK_IOI) {

所以 YZ 是谁(

下划线

===== Successfully open the file   answers\JX-0025\water\water.cpp.The size of it is 1.318 KB.
......
const int _ = 1e5 + 7;
const int __ = 5e5 + 7;

int n, m, de[_], od[_];
ll p[_], q[_];
int lst[_], nxt[__], to[__], tot;
===== Successfully open the file answers\JX-0025\string\string.cpp.The size of it is 1.697 KB.
......
const int _ = (1 << 20) + 7;
const int M = 26;

int n, num[2][_], sum[_][M + 7], nxt[_];
char s[_];
===== Successfully open the file     answers\JX-0025\ball\ball.cpp.The size of it is 3.126 KB.
......
const int _ = 50 + 7;
const int __ = 400 + 7;
const int ___ = 1e7 + 7;
const int lim = 1e7;

int N, m, n, stk[_][__], top[_], num[_][__], X, tot, cur, sum[_], a;
bool flag;
pair<int, int> act[___];
int numAct;
===== Successfully open the file     answers\JX-0025\walk\walk.cpp.The size of it is 0.931 KB.
......
const int _ = 100 + 7;
const int __ = 5e5 + 7;

int n, K, w[_], c[__], d[__], ans;
int pos[_], st[_];
===== Successfully open the file answers\JX-0059\string\string.cpp.The size of it is 2.172 KB.
......
const int _ = (1<<20)+1;
ull H[_], H2[_]; // H[i] = hash(s[1..i]);
char str[_]; ull inv[_], inv2[_]; ull mod=993244853, mod2=998244853; int n, times[_], f[_], _f[_];

下划线邪教出现了!

===== Successfully open the file   answers\JX-0018\water\water.cpp.The size of it is 1.325 KB.
......
        long long g=__gcd(tp,tq);tp=tp/g,tq=tq/g;//约分
......
                g=__gcd(a[temp].p,a[temp].q);a[temp].p=a[temp].p/g,a[temp].q=a[temp].q/g;//约分
===== Successfully open the file   answers\JX-0040\water\water.cpp.The size of it is 2.368 KB.
......
      gg=(long long)__gcd(aa[i],bb[i]);
......
      g=__gcd(bb[fl[c]],b);
===== Successfully open the file   answers\JX-0047\water\water.cpp.The size of it is 1.093 KB.
......
        te=__gcd(max(fz,fm),min(fz,fm));
......
        te=__gcd(max(zz,mm),min(zz,mm));
......
                te=__gcd(max(zhi[i],mu[i]),min(zhi[i],mu[i]));
===== Successfully open the file   answers\JX-0063\water\water.cpp.The size of it is 1.423 KB.
......
    int res=__gcd(dis[x][1],1ll*j);
......
                res=__gcd(dis[x][0],dis[x][1]*out[x]);
......
            if(dis[i][0]) {res=__gcd(dis[i][0],dis[i][1]);}

让我们恭喜(迫真)这些 __gcd 人。

qwq

===== Successfully open the file   answers\JX-0004\water\water.cpp.The size of it is 1.521 KB.
 for(i=1;i<=m;i++) 
    {p[i]=1;dui[++t]=i;} //cout<<t<<"qwq"<<endl;
===== Successfully open the file   answers\JX-0015\water\water.cpp.The size of it is 1.288 KB.
//          cout<<u<<' '<<v<<' '<<p[u]<<' '<<q[u]<<' '<<p[v]<<' '<<q[v]<<" qwq\n";
===== Successfully open the file answers\JX-0015\string\string.cpp.The size of it is 1.541 KB.
#define dg puts("qwq")
//      cout<<hash(1,3)<<' '<<hash(4,6)<<"qwqwqwq\n";
===== Successfully open the file     answers\JX-0015\ball\ball.cpp.The size of it is 1.606 KB.
#define dg puts("qwq")
===== Successfully open the file     answers\JX-0058\walk\walk.cpp.The size of it is 1.264 KB.
}//调了两个多小时qwq

大家都很喜欢 qwq 调试诶(

5.注释

===== Successfully open the file     answers\JX-0019\walk\walk.cpp.The size of it is 3.118 KB.
......
/*void madoka(){
    printf("kamisama");
    return ;
}*/
......

这啥啊 /yun

upd:经科普,madoka是魔法少女小圆里的一个角色,kamisama是日语中神仙的意思

===== Successfully open the file   answers\JX-0028\water\water.cpp.The size of it is 1.722 KB.
#include<vector>  /* that day mzx away from OI */
......

AFO /jk 祝好

===== Successfully open the file answers\JX-0077\string\string.cpp.The size of it is 1.697 KB.
......
    /*biekan
    ......
    */

别看 可还行。

最后,祝万恶之源Vector_一帆风顺:(这里仅截取了每份代码最后的注释)

===== Successfully open the file   answers\JX-0113\water\water.cpp.The size of it is 1.667 KB.
//By Vector_,JX-00113.XD
//Vector_ is going to AFO.:(
//Hope all of you could rp++,and ak ioi.:D
//Goodbye.
//Luogutxdy!!
===== Successfully open the file answers\JX-0113\string\string.cpp.The size of it is 2.251 KB.
}
//Vector_ Freedom Dived!
//Feeling Very Good!
//:(
//WA :(

//2h passed

//No sence!

//completely cant do it!

//:(

//baolilaman
===== Successfully open the file     answers\JX-0113\ball\ball.cpp.The size of it is 0.208 KB.
//Play You A Ball!!!

//*Vector got mad.
===== Successfully open the file     answers\JX-0113\walk\walk.cpp.The size of it is 4.361 KB.
//?
//sm**
//I TLE NOIP 2020
//****

//(luogu zanghua)

//Vector will be AFOed after writing this,"walk".
//It started from A+B,and ended in the walk.
//Vector maybe attend some contest about coding,but no more as a OIER.

//maybe a ACM/ICPCer

//Goodbye,Luogu

//R.I.P. Vector_(As an OIer)

//2014~2020