跳到正文

休闲·娱乐

JX CSP-J2026迷惑行为大赏

_CMZ_Lychee_约 62 分钟
原文
文章信息与版本

文章信息

发布
2026年11月6日
收录
2026年11月21日
更新
2026年11月21日
篇幅
约 62 分钟

版本

  1. v1当前

嗯对发现文章广场没有咱 JX 的,作为一只合格的草履虫,我 S 挂掉了所以不想整理 S 组的……使用了非常非常少的免费的 DeepSeek v4.1 辅助整理,依旧娱乐向,不代表本人对本场比赛题目的看法。

突然又有兴趣肝了但是看着乱七八糟的码有点无语大删重来了,直接把 DeepSeek 老师请走我上人工,尝试分批。

JX-J00001~JX-J00020

欢迎大家观看第一组的赛事,本组参赛选手共 7 人(我的空格键怎么总是卡)。

第一位选手(JX-J00002)的 T2 写了一个十分明显的暴力,ta 给我们展示了一下写暴力结果都爆零了的绝望,抱抱这位选手。

代码
C++
#include<bits/stdc++.h>
using namespace std;
string s="";
long long hw(){
    long long sum=0;
    for(int i=0,j=s.size()-1;i<=j,j>=i;i++,j--){
        if(s[i]!=s[j])sum++;
    }
    return sum;
}
int main(){
	freopen("string6.in","r",stdin);
	freopen("string.out","w",stdout);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
        int a;
        char c;
        cin>>a>>c;
        for(int j=1;j<=a;j++){
            s+=c;
        }
	}
	cout<<hw();
	return 0;
}

第二位选手(JX-J00004)在 T2 为我们开展了一场“寻找分号”的游戏,同时,也非常人性化的没有写 freopen,这警示了一大批一大批的后人。

代码
C++
#include<bits/stdc++.h>
using namespace std;
#define int long long
struct node{
    int a;
    char c;
}
const int N=2e5+5;
node arr[N];
//vector<nod> 5;

int n;
signed main(){
    cin>>n;
    int len=0;
    cin>>arr[1].a>>arr[1].c;
    len += arr[1].a;
    int p=1;
    s[p].a=arr[p].a.s[p].c=arr[p].c;
    for(int i=1;i<=n;i++){
        cin>>arr[1].a>>arr[1].c;
        len+=arr[1].a;
        if(arr[i].c==arr[i-1].c)s[p].a+=arr[i].a;
        else{
            p++;
            s[p].a=arr[i].a;
            s[p].c=arr[i].c;
        }
        if(p==1){
            cout<<0;
            return 0;
        }
    }
    int x=len/2;
    int l=1;r=p;
    int s1=0,s2=0;
    int cnt=0;
    while(l<r){
		if(s1+s2==len)break;
		if(s[l].c==s[r].c){
			cnt+=abs(s[r].a-a[l].a);
			cnt+=s[r].a-s[l].a;
			s1+=s[l].a,s2+=s[l].a;
			s[r].a-=s[i].a;
			
			}
			else{
				cnt+=s[l].a-s[r].a;
				r--;
				a[l].a-=s[r].a;
				}
			
		}
	}

同时,这位选手的 T3 输样例失败了。

C++
#include<bits/stdc++.h>
using namespace std;
int main(){
    freopen("and.in","r",stdin);
    freopen("and.out","w",stdout);
    int n,m;
    cin>>n>>m;
    for(int i=0;i<=n;i++){
		cin>>n[i];
		
		}
    cout<<"12";
}

目光看到第三位选手(JX-J00007)的 T2,同样打了一个暴力,甚至附有英文解说。

C++
#include<bits/stdc++.h>
using namespace std;//compare the first half with the other! Do it two times and use min(ans1,ans2)!
int n,ans=0;
string s;
int main(){
	freopen("string.in","r",stdin);
	freopen("string.out","w",stdout);
	cin>>n;
	for(int i=0;i<n;i++){
		int a;
		char c;
		cin>>a>>c;
		for(int j=0;j<a;j++){
			s+=c;
		}
	}
	int sz=s.size();
	for(int i=0;i<sz/2;i++){
		if(s[i]!=s[sz-i-1])ans++;
	}
	cout<<ans;
	return 0;
}

好的让我们看看第四位选手(JX-J00010)在干什么,奈何其 T2 freopen 的文件名多加了一个 1,导致与 32 pts 失之交臂。

代码
C++
#include<bits/stdc++.h>
using namespace std;
string s;
const int N=2e5+5;
int n,cnt[N];
long long ans,cnt1sum,cnt2sum,cntsum;
char a[N];
int main()
{
    freopen("string1.in","r",stdin);
    freopen("string.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>cnt[i];
        cin>>a[i];
        cntsum=cntsum+cnt[i];
    }
    int zuo=1,you=n;
    for(long long i=1;i<=cntsum/2;i++)
    {
        if(a[zuo]!=a[you]){
                if(cnt1sum+cnt[zuo]>cnt2sum+cnt[you])
                {
                cnt2sum+=cnt[you];
                ans+=min(cnt[zuo],cnt[you]);
                i+=min(cnt[zuo],cnt[you]);
                you--;
                }
                else if(cnt1sum+cnt[zuo]<cnt2sum+cnt[you])
                {
                cnt1sum+=cnt[you];
                ans+=min(cnt[zuo],cnt[you]);
                i+=min(cnt[zuo],cnt[you]);
                zuo++;
                }
                else{
                    i+=cnt[zuo];
                    ans+=cnt[zuo];
                    zuo++;
                    you--;
                }
        }
        else{
            if(cnt1sum+cnt[zuo]>cnt2sum+cnt[you])
            {
                cnt2sum+=cnt[you];
                you--;
                i+=min(cnt[zuo],cnt[you]);
            }
            else if(cnt1sum+cnt[zuo]<cnt2sum+cnt[you])
                {
                cnt1sum+=cnt[you];
                i+=min(cnt[zuo],cnt[you]);
                zuo++;
                }
            else{
                i+=cnt[zuo];
                    zuo++;
                    you--;
            }
        }
    }
    cout<<ans;
    return 0;
    //cout<<s;
}

与此同时,第五位选手(JX-J00012)在 T3 写了一篇英语游记(我也不擅长英语所以可能有一些地方不是作者的原意)。

翻译

欢迎来看我写得比较粗糙的文段和代码,我叫 Chan。我怎样才能用中文来描述呢。我不太擅长英语,所以如果我的代码被别人发到洛谷上,会有人来回答我的问题吗?我猜没有人会理解我的句子。

我尝试安装中文包,但是我并不知道 NOI 的密码。

11:36,有些人提交了他们的代码并想要离开,我有一些焦虑。

在我的右边,一个男孩询问了很多奇怪的问题。我猜这是他第一次参加 CSP。

哦,我写的太菜了。

第一个 n 是我将要选的编号,第二个 n 是我一共选了多少个数,2 代表我是否选择这个数。

10.31。

我觉得这是 01 背包的升级版,但是我没有认真学 QWQ。

11:13,我提交了我完整的代码。

特判 1:我只能选择 1 个数字。特判 2:我必须选择全部数字。 I more like to use VScode, but when i practice how to use the NOI Linux, i used the Code::Blocks IDE. 我更喜欢使用 VScode 一些,但是当我练习如何使用 NOI Linux 系统的时候,我使用的是 Code::Blocks IDE。

代码
C++
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long a[N];
// Welcome to watch my bad passages and code, my name is Chan.

// How can i use the Chinese to write my word.
// I'm not good at English, so if my code was published by someone on Luogu, have anyone answer my question?
// I guess no one can understand my sentences.

// I try to install the Chinese package, but i don't know the password of NOI.
// 11:36 Someone give their code and wanna go back, I felt so anxiety.
// In my right, a boy asked many strange questions.
// I guess it was his first time to attend the CSP.
// Oh, I write so bad. /(* o *)\

// The first n is the number i will choose.
// The second n is the how many number was chose by me.
// The 2 is i choose the number or not.

// Oct. 31
int n, m;
long long maxn;
int main() {
    freopen("and.in", "r", stdin);
    freopen("and.out", "w", stdout);
    cin >> n >> m;
    srand(time(0));
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        // I think it is 01 bag problem plus, but i didn't learnt it carefully, QWQ.
        // dp[i][1][1] = a[i];
        // 11:13 I give up to write the complete code.
        maxn = max(maxn, a[i]);
    }
    sort(a + 1, a + 1 + n);
    // Case 1: I can only choose one number.
    if (m == 1)
        cout << maxn;
    // Case 2: I must choose all the number.
    else if (m == n) {
        long long ans = a[1];
        for (int i = 1; i <= n; i++) {
            ans &= a[i];
        }
        cout << ans;
    }
    else if (m == 2) {
        long long ans = 0;
        for (int i = 1; i < n; i++) {
            for (int j = i + 1; j <= n; j++) {
                ans = max(ans, a[i] & a[j]);
            }
        }
        cout << ans;
    }
    else {
        long long ans = a[n];
        for (int i = n; i >= n - m + 1; i--)
            ans &= a[i];
        cout << ans;
    }
    cout << endl;


    /*
    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; i <= n; i++) {
            dp[j][][1] = max()
        }
    }
    */
    return 0;
}
// I more like to use VScode, but when i practice how to use the NOI Linux, i used the Code::Blocks IDE.

有请第六位选手(JX-J00017),显而易见 ta 似乎在 T2 当中很担心 RE,于是开了一个内存为 4GB 的数组。

代码
C++
#include <bits/stdc++.h>
using namespace std;
int main()
{
    freopen("string.in","r",stdin);
    freopen("string.out","w",stdout);
    int n,a[1000000001],sum = 0,num = 0,aum = 0,rum = 0;
    string b,c;
    a[0] = 0;
    cin >>n;
    for (int i = 1;i <= n;i++)
    {
        cin >> a[i];
        aum += a[i];
        cin >> b;
        for (int j = rum + 1;j <= aum;j++)
        {
            c[j] = b [0];
            sum++;
        }
        rum += a[i];
    }
    for(int i = 1;i <= sum;i++)
    {
        for (int j = sum;j >= 1;i--)
        {
            if(c[i] != c[j])
            {
                c[j] = c[i];
                num++;
            }
        }
    }
    cout << num;
    return 0;
}

接着我们来看看第七位选手的表现(JX-J00018),或许是某种不可名状的缘故,ta 在 T3 写出了打表版暴力。

代码
C++
#include<bits/stdc++.h>
using namespace std;
long long a[200010];
int n,m;
long long maxn,andn;
int main(){
    freopen("and.in","r",stdin);
    freopen("and.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>m;
    for(long long i=1;i<=n;i++){
        cin>>a[i];
        maxn=max(maxn,a[i]);
        if(i==1) andn=a[i];
        else andn&=a[i];
    }
    if(m==1){
        cout<<maxn;
        return 0;
    }
    if(m==n){
        cout<<andn;
        return 0;
    }
    if(m==n-1){
        long long pron=a[2];
        maxn=-1;
        for(int i=3;i<=n;i++){
            pron&=a[i];
        }
        maxn=max(maxn,pron);
        for(int i=2;i<=n;i++){
            pron=a[1];
            for(int j=2;j<=n;j++){
                if(j==i) continue;
                pron&=a[j];
            }
            maxn=max(maxn,pron);
        }
        cout<<maxn;
        return 0;
    }
    if(m==2){
        maxn=-1;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                long long pron=a[i] & a[j];
                maxn=max(maxn,pron);
            }
        }
        cout<<maxn;
        return 0;
    }
    if(m==3){
        maxn=-1;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                for(int k=j+1;k<=n;k++){
                    long long pron=a[i] & a[j] & a[k];
                    maxn=max(maxn,pron);
                }
            }
        }
        cout<<maxn;
        return 0;
    }
    if(m==4){
        maxn=-1;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                for(int k=j+1;k<=n;k++){
                    for(int q=k+1;q<=n;q++){
                        long long pron=a[i] & a[j] & a[k] & a[q];
                        maxn=max(maxn,pron);
                    }
                }
            }
        }
        cout<<maxn;
        return 0;
    }
    if(m==5){
        maxn=-1;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                for(int k=j+1;k<=n;k++){
                    for(int q=k+1;q<=n;q++){
                        for(int w=q+1;w<=n;w++){
                            long long pron=a[i] & a[j] & a[k] & a[q] & a[w];
                            maxn=max(maxn,pron);
                        }
                    }
                }
            }
        }
        cout<<maxn;
        return 0;
    }
    if(m==6){
        maxn=-1;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                for(int k=j+1;k<=n;k++){
                    for(int q=k+1;q<=n;q++){
                        for(int w=q+1;w<=n;w++){
                            for(int e=w+1;e<=n;e++){
                                long long pron=a[i] & a[j] & a[k] & a[q] & a[w] & a[e];
                                maxn=max(maxn,pron);
                            }
                        }
                    }
                }
            }
        }
        cout<<maxn;
        return 0;
    }
    if(m==7){
        maxn=-1;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                for(int k=j+1;k<=n;k++){
                    for(int q=k+1;q<=n;q++){
                        for(int w=q+1;w<=n;w++){
                            for(int e=w+1;e<=n;e++){
                                for(int r=e+1;r<=n;r++){
                                    long long pron=a[i] & a[j] & a[k] & a[q] & a[w] & a[e] & a[r];
                                    maxn=max(maxn,pron);
                                }
                            }
                        }
                    }
                }
            }
        }
        cout<<maxn;
        return 0;
    }
    if(m==8){
        maxn=-1;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                for(int k=j+1;k<=n;k++){
                    for(int q=k+1;q<=n;q++){
                        for(int w=q+1;w<=n;w++){
                            for(int e=w+1;e<=n;e++){
                                for(int r=e+1;r<=n;r++){
                                    for(int t=r+1;t<=n;t++){
                                        long long pron=a[i] & a[j] & a[k] & a[q] & a[w] & a[e] & a[r] & a[t];
                                        maxn=max(maxn,pron);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        cout<<maxn;
        return 0;
    }
    if(m==9){
        maxn=-1;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                for(int k=j+1;k<=n;k++){
                    for(int q=k+1;q<=n;q++){
                        for(int w=q+1;w<=n;w++){
                            for(int e=w+1;e<=n;e++){
                                for(int r=e+1;r<=n;r++){
                                    for(int t=r+1;t<=n;t++){
                                    for(int y=t+1;y<=n;y++){
                                            long long pron=a[i] & a[j] & a[k] & a[q] & a[w] & a[e] & a[r] & a[t] & a[y];
                                            maxn=max(maxn,pron);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        cout<<maxn;
        return 0;
    }
    if(m==10){
        maxn=-1;
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                for(int k=j+1;k<=n;k++){
                    for(int q=k+1;q<=n;q++){
                        for(int w=q+1;w<=n;w++){
                            for(int e=w+1;e<=n;e++){
                                for(int r=e+1;r<=n;r++){
                                    for(int t=r+1;t<=n;t++){
                                        for(int y=t+1;y<=n;y++){
                                            for(int u=y+1;u<=n;u++){
                                                long long pron=a[i] & a[j] & a[k] & a[q] & a[w] & a[e] & a[r] & a[t] & a[y] & a[u];
                                                maxn=max(maxn,pron);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        cout<<maxn;
        return 0;
    }
    return 0;
}

(中间由于空格键太卡了于是请求了一下父亲的支援,也是非常成功的使 space 不卡了)

鉴于作者的客观评价,决定将本组胜出者给到 JX-J00012 这位 Chan 同志,因为 ta 是本组唯一一个用心在写游记而且英语还特别好的同志。

本组统计:

关于 freopen 的:3。
关于注释的:2。
关于数组大小的:1。
关于暴力:1。

JX-J00021~JX-J00040

本组共 4 名参赛选手。

第二组第一位选手(JX-J00022)貌似数学上瘾,导致其四题代码的 freopen 全都是 math。

代码
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
    freopen("math.in","r",stdin);
    freopen("math.out","w",stdout);
    char c1,c2;
    int a,b,c,d;
    cin>>a>>b>>c1>>c>>d>>c2;
    if(a==c){
        if(b==d||d==b){
            if(c1=='A'&&c2=='B'||c1=='B'&&c2=='A'||c1=='B'&&c2=='C'||c1=='C'&&c2=='B'||c1=='D'&&c2=='E'||c1=='E'&&c2=='D'){
                cout<<"1111";
            }
            else{
                cout<<"1100";
            }
        }
        else{
            cout<<"1000";
        }
    }
    else{
        cout<<"0000";
    }
    return 0;
}
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
    freopen("math.in","r",stdin);
    freopen("math.out","w",stdout);
    int n;
    string s;
    for(int i=1;i<=n;i++){

    }
    return 0;
}
C++
#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
    freopen("math.in","r",stdin);
    freopen("math.out","w",stdout);
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }

    return 0;
}
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
    freopen("math.in","r",stdin);
    freopen("math.out","w",stdout);
    int n,m;
    int a[500005];
    cin>>n;

    return 0;
}

第二位选手(JX-J00030)在 T3 稳定发挥,一不小心就在 freopen 前面打上了几个斜杠。

代码
C++
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,m,a[N],zd;
int 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 i=1;i<=n;i++)
    {
        int s=0,x=a[i];
        string b="",d="";
        while(x!=0)
        {
            b+=char(x%2+48);
            x=x/2;
        }
        for(int j=i;j<i+m-1;j++)
        {
            int y=a[j+1];
            string c="";

            while(y!=0)
            {
                c+=char(y%2+48);
                y=y/2;
            }
            for(int k=0;k<max(b.size(),c.size());k++)
            {
                if(b[k]=='0'||c[k]=='0') d+='0';
                else d+='1';
            }
            reverse(d.begin(),d.end());
            b=d;
            d="";
        }
        reverse(b.begin(),b.end());
        for(int k=0;k<b.size();k++) s=s+(b[k]-'0')*pow(k,2);

        zd=max(s,zd);

    }
    cout<<zd;
	return 0;
}

同时,这位选手把旅行和打牌混为一谈了(以下为 T4 代码)。

代码

#include<bits/stdc++.h> using namespace std; const int N=5e5+10; int n,m,a[N],b[N],js=1; int main() { freopen(“travel.in”,“r”,stdin); freopen(“travel.out”,“w”,stdout); cin>>n>>m; for(int i=1;i<=n;i++) { cin>>a[i]; b[a[i]]++; } b[a[n]]=n; for(int i=1;i<=m;i++) if(i!=a[n]) b[i]=b[i]+2-i; for(int i=1;i<=m;i++) cout<<b[i]<<’ ’;

代码
return 0;

}

接着是第三位选手(JX-J00031),其 T1 尝试欺骗我们的 AI 告诉它自己写了 freopen(呃呃之前那个 AI 搞了一部分然后没查到这位)。

代码
C++
#include <bits/stdc++.h>
using namespace std;
freopen("travel.in","r",stdin);
freopen("travel.out","w",stdout);
int main()
{
    int ci,cj;
    char si,sj;
    cin>>ci;
    cin>>si;
    cin>>cj;
    cin>>sj;
    sj-=1;
    cout<<si<<" "<<sj<<endl;
    cout<<ci<<" "<<cj<<endl;
    if(ci%cj==0)
    {
        cout<<"1";
        if(si==sj || si==sj+2)
        {
            cout<<"1";
            if(ci==cj)
            {
                cout<<"1";
                if(ci==cj)
                {
                    cout<<"1";
                }
                else
                {
                    cout<<"0";
                }
            }
            else
            {
                cout<<"00";
            }
        }
        else
        {
            cout<<"000";
        }
    }
    else
    {
        cout<<"0000";
    }
	return 0;
}

且其同样旅行上瘾,别人在玩回文串和钓鱼,就这位在到处旅行(T2 和 T4 的代码)。

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

然后 T3 忘记写 freopen 了。

代码

#include <bits/stdc++.h> using namespace std; long a[200001]={0}; int main() { int n,m,num=0,snum=0; cin>>n>>m; for(int i=0;i<n-1;i++) { cin>>a[i]; } for(int i=0;i<n;i++) { for(int j=i+1;j<n;j++) { snum=a[i]&&a[j]; num=max(num,a[i]&&a[j]); cout<<” “<<snum<<” ”; cout<<a[i]&&a[j]; } } cout<<num<<endl; return 0; }

第四位选手(JX-J00038)——fravel 之人。

代码
C++
#include<bits/stdc++.h>
using namespace std;
int a[4];
int main(){
    freopen("fravel.in","r",stdin);
    freopen("fravel.out","w",stdout);
    for(int i=0;i<4;i++){
        a[i]=1;
        if(i==2){
            a[i]=0;
        }
    }
    int yiu=0,pai=0,xian=0;
    string c1,s1,c2,s2;
    cin>>c1>>s1>>c2>>s2;
    for(int i=0;i<2;i++){
        if(c1[i]!=c2[i]){
            a[0]=0;
            xian=1;
            break;
        }
    }
    for(int i=0;i<2;i++){
        if(xian==0){
            if(s1[i]!=s2[i]){
                a[1]=0;
                pai=1;
                break;
            }
        }
        else{
            a[1]=0;
            pai=1;
            break;
        }
    }
    for(int i=2;i>=2;i--){
        if(s1[i]>'C'&&s2[i]>'C'||s1[i]<='C'&&s2[i]<='C'&&pai==0){
            a[2]=1;
            yiu=1;
            break;
        }
    }
    for(int i=2;i>=2;i--){
        if(abs(s1[i]-s2[i])!=1||yiu==0){
            a[3]=0;
            break;
        }
    }
    for(int i=0;i<4;i++){
        cout<<a[i];
    }
    return 0;
}

本组人有点儿少啊,与上一组形成了鲜明的对比,那么我将把本组获胜者给到 JX-J00022 这位选手,显然其数学一定特别好。

本组统计:

关于 freopen 的:4。

JX-J00041~JX-J00060

本组共 7 位参赛选手。

请看我们的第一位选手(JX-J00041),ta 的 T2 表演了一次对 CCF 的求情。

代码

“cpp /* shu ju fan wei xia ku le TVT CCF bu yao zhe yang dui wo… */ #include<bits/stdc++.h> using namespace std; const int N=2e5+10; long long a[N]; char c[N]; int n; long long s,ans; int main(){ freopen(“string.in”,“r”,stdin); freopen(“string.out”,“w”,stdout); cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]>>c[i]; s+=a[i]; } for(int i=1;i<=n/2;i++){ if(a[i]==a[n-i+1]&&c[i]!=c[n-i+1]) ans+=a[i]; if(a[i]!=a[n-i+1]){ if(a[i]>a[n-i+1]){ if(c[i]==c[n-i+1]){ if(c[i]!=c[n-i]){ ans+=a[i]-a[n-i+1]; a[n-i]=a[n-i]-(a[i]-a[n-i+1]); } } else{ if(c[i]!=c[n-i]){ ans+=a[i]; a[n-i]=a[n-i]-(a[i]-a[n-i+1]); } else ans+=a[n-i+1]; } } else{ if(c[i+1]==c[n-i+1]){ if(c[i+1]!=c[n-i+1]){ ans+=a[n-i+1]-a[i]; a[i+1]=a[i+1]-(a[n-i+1]-a[i]); } } else{ if(c[i]!=c[n-i]){ ans+=a[n-i+1]; a[i+1]=a[i+1]-(a[n-i+1]-a[i]); } else ans+=a[i]; } } } } cout<<ans<<‘\n’; return 0; }

代码

同时,这位选手在 T3 发自内心的询问自己是否还有救。

代码
C++
/*
wang le an wei yu shi shen me le hai you jiu ma? QAQ
*/
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
string w;
int n,m;
int a[N];
// void ejz(int x){
//     int i=0;
//     w[0]=0;
//     while(x!=0){
//         cout<<x%2;
//         x/=2;
//         i++;
//     }
//     cout<<endl;
// }
int main(){
    freopen("and.in","r",stdin);
    freopen("and.out","w",stdout);
    cin>>n>>m;
    // for(int i=1;i<=n;i++){
    //     cin>>a[i];
    //     ejz(a[i]);
    //     //cout<<a[i]<<' ';
    // }
    cout<<1;
    return 0;
}

最后,在 T4 献唱了一句歌词&kkk。

代码
C++
/*
cha yi bu mei man
*/
#include<bits/stdc++.h>
using namespace std;
const int N=5e5+10;
int a[N],p[N],vis[N];
int n,m;
void kkk(){
    for(int i=1;i<=m;i++){
        if(vis[i]){
            p[i]++;
            vis[i]=0;
        }
    }
}
void pd(int x){
    for(int i=1;i<=n;i++){
        int d=a[i];
        if(vis[d]){
            for(int j=x;j<=n;j++){
                vis[a[j]]=0;
                if(a[j]==d) break;
            }
        }
        vis[d]=1;
    }
    kkk();
    return ;
}
int 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++) pd(i);
    for(int i=1;i<=m;i++){
        if(p[i]) cout<<p[i]<<' ';
    }
    return 0;
}

第二位选手(JX-J00043)显然是挂掌架(trave)之人(甚至没打引号)。

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

int main()
{

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

    char c1[2];
    char s1[3];
    char c2[2];
    char s2[3];
    for(int i=0;i<=1;i++)
    {
        cin>>c1;
    }
    for(int i=0;i<=2;i++)
    {
        cin>>s1;
    }
    for(int i=0;i<=1;i++)
    {
        cin>>c2;
    }
    for(int i=0;i<=2;i++)
    {
        cin>>s2;
    }
    if(c1[1]==c2[1])
        {
            cout<<'1';
        }
        else{
            cout<<'0';
        }

     if(s1[0]==s2[0]&&s1[1]==s2[1])
        {
            cout<<'1';
        }
        else{
            cout<<'0';
        }

        if(s1[2]=='A'||'B'||'C'&&s2[2]=='A'||'B'||'C'||s1[2]=='F'||'D'&&s2[2]=='F'||'D')
        {
           cout<<'1';
        }
        else{
            cout<<'0';
        }
    return 0;
}

第三位选手(JX-J00048)为 cxh & zwh & kkk 之人。

代码(T1)
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
    freopen("travel.in","r",stdin);
    freopen("travel.out","w",stdout);
    int cxh_R,cxh_X;
    string zwh_R,zwh_X;
    cin>>cxh_R>>zwh_R>>cxh_X>>zwh_X;
    if(cxh_R==cxh_X){
        cout<<"1";
        char r = zwh_R[2],x = zwh_X[2];
        if(zwh_R[0]==zwh_X[0]&&zwh_R[1]==zwh_X[1]){
            cout<<"1";
            if((r>='D'&&x>='D')||(r<='C'&&x<='C')){
                cout<<"1";
                if((r=='D'&&x=='F')||(r=='F'&&x=='D')){
                    cout<<"1";
                }
                else if((r=='C'&&x=='B')||(r=='B'&&x=='C')||(r=='B'&&x=='A')||(r=='A'&&x=='B')){
                    cout<<"1";
                }
                else{
                    cout<<"0";
                }
            }
            else{
                cout<<"00";
            }
        }
        else{
            cout<<"000";
        }
    }
    else{
        cout<<"0000";
    }
    return 0;
}
代码(T3)
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    freopen("and.in","r",stdin);
    freopen("and.out","w",stdout);
    int m,n;cin>>n>>m;
    vector<int> a;
    int mkk=((1<<30)-1);
    int ans=0;
    for(int i=0;i<n;i++){
        int tmp;cin>>tmp;
        a.push_back(tmp);
    }
    vector<vector<int> > dcl;
    int y=-1;
    for(int i=1;i<((1<<a.size())-1);i++){
        if(__builtin_popcount(i)==m){
            vector<int> ttt;
            for(int j=0;(1<<j)<=i;j++){
                if((1<<j)&i){
                    ttt.push_back(a[j]);
                }
            }
            dcl.push_back(ttt);
        }
    }
    for(int i=0;i<dcl.size();i++){
        int kkk=mkk;
        for(int j=0;j<m;j++){
            kkk = (kkk&dcl[i][j]);
        }
        ans=max(ans,kkk);
    }
    cout<<ans;
    return 0;
}

第四位选手(JX-J00051)貌似注释掉了 T3 freopen,甚至 and1。

代码
C++
#include<bits/stdc++.h>
using namespace std;
int a[200010];
struct node{
    int x,v,num;
}dl[1000010];
int main(){
    freopen("and1.in","r",stdin);
    //freopen("and.out","w",stdout);
    int n,m,ans=-2147483647;
    int head=1,tail=1;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        dl[tail].v=a[i];
        dl[tail].num=1;
        dl[tail].x=i;
        tail++;
    }
    while(head<=tail){
        cout<<head<<" "<<tail<<endl;
        if(dl[head].num==m){
            ans=max(ans,dl[head].v);
        }
        else{
            cout<<dl[head].x<<"         ";
            for(int i=dl[head].x+1;i<=n;i++){
                /*dl[tail].v=(dl[head].v&a[i]);*/
                dl[tail].num=dl[head].num+1;
                dl[tail].x=i;
                tail++;
            }
        }
        head++;
    }
        for(int i=1;i<=n;i++){
        //cin>>a[i];
        cout<<dl[i].v<<"   ";
        cout<<dl[i].num<"    ";
        cout<<dl[i].x<<"     ";
        //tail++;
    }
    cout<<ans;
}

第五位选手(JX-J00056)注释 T3 freopen ✕2。

代码
C++
#include <bits/stdc++.h>
using namespace std;
int n,m,as=(1<<31)-1,a[200001];
bool cmp(int x,int y){
    return x>y;
}
int main(){
	//freopen("and.in","r",stdin);
	//freopen("and.out","w",stdout);
	cin >>n>>m;
	for(int i=1;i<=n;i++)
        cin >>a[i];
    sort(a+1,a+n+1,cmp);
    for(int i=1;i<=m;i++){
        as&=a[i];
    }
    cout <<as;
	return 0;
}

第六位选手(JX-J00057),freopen 写错之人。

代码
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
    string c1,s1,c2,s2;
    (stdin,"travel.in",cin);
    (stdout,"travel.out",cout);
    cin>>c1>>s1>>c2>>s2;
    if(c1==c2)
        cout<<1;
    else
        cout<<0;
    if(c1==c2&&s1[0]==s2[0]&&s1[1]==s2[1])
        cout<<1;
    else
        cout<<0;
    if(c1==c2&&s1[0]==s2[0]&&s1[1]==s2[1]&&((s1[2]='A'||s1[2]='B'||s1[2]='C')&&(s2[2]='A'||s2[2]='B'||s2[2]='C'))||((s1[2]='C'||s1[2]='D')&&(s2[2]='C'||s2[2]='D')))
        cout<<1;
    else
        cout<<0;
    if(ci==c2&&s1==s2)
        cout<<1;
    else
        cout<<0;
    return 0;
}
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
    (stdin,"string.in",cin);
    (stdout,"string.out",cout);
    long long n,L=0,ans=0;
    cin>>n;
    string S;
    for(int i=0;i<n;i++){
        int a,c;
        cin>>a>>c;
        L+=a;
        for(int i=0;i<a;i++)
            S+=c;
    }
    for(int i=0;i<L/2;i++){
        if(S[i]!=S[L+1-i])
            ans+=1;
    }
    cout<<ans;
    return 0;
}
C++
#include<bits/stdc++.h>
using namespace std;
long long n,m;
vector<long long> nums;
vector<long long> ans;
vector<long long> S;
void dfs(int x){
    if(x>m){
        int num=nums[0];
        for(int i=1;i<m;i++)
            nums[i]&=num;
        ans.push_back(num);
        vector<long long> nums;
    }
    for(int i=x;i<n;i++){
        nums.push_back(S[i]);
        dfs(++x);
    }
}
int main(){
    (stdin,"and.in",cin);
    (stdout,"and.out",cout);
    cin>>n>>m;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        S.push_back(a);
    }
    dfs(0);
    sort(ans.begin(),ans.end());
    cout<<ans[ans.size()-1];
    return 0;
}
C++
#include<bits/stdc++.h>
using namespace std;
long long n,m;
long long ans[300010];
vector<long long> S;
void dfs(int x,int m){
    int cards[m]={0};
    for(int i=x;i<n;i++){
        cards[S[i]]+=1;
        if(cards[s[i]]>1)
            dfs(i);
    }
    for(int i=0;i<m;i++)
        ans[i]+=cards[i];
}
int main(){
    (stdin,"card.in",cin);
    (stdout,"card.out",cout);
    cin>>n>>m;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;
        S.push_back(a);
    }
    for(int i=0;i<n;i++)
        dfs(i,m);
    for(int i=0;i<m;i++)
        cout<<ans[i]<<' ';
    return 0;
}

兄弟你是不是一不小心学错了怎么写文件输入输出。

第七位选手(JX-00059)似乎尝试开一个大小 10810^8 的数组。

代码
C++
#include<bits/stdc++.h>
using namespace std;
char s[100000001],ss[100000001];
long long n,m,sum=0,cnt=0,l,r;
int main()
{
	freopen("string.in","r",stdin);
	freopen("string.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        int a;
        char c;
        cin>>a>>c;
        for(int j=1;j<=a;j++){
            s[++cnt]=c;
        }
    }
    long long p=cnt;
    for(int i=1;i<=cnt;i++,p--){
		ss[i]=s[p];
	}
	for(int i=1;i<=(cnt+1)/2;i++)
	{
		if(ss[i]!=s[i])sum++;
	}
    cout<<sum;
    fclose(stdin);
    fclose(stdout);
    return 0;
}

经过考虑呢作者决定将本组桂冠戴在“差一步美满”的 JX-J00041 兄弟头上。

统计:

关于 freopen 的:4。
关于数组的:1。
关于注释:1。
关于变量名:1。

JX-J00061~JX-J00080

啧,明天肝,人工审核还是太累了。

原文