跳到正文

个人记录

NOIP 2021 迷惑代码大赏(AH)

X沙兴安A约 16 分钟
原文
文章信息与版本

文章信息

发布
2021年11月20日
收录
2025年12月12日
更新
2026年11月17日
篇幅
约 16 分钟
获赞
31

版本

  1. v1当前

引言

作者使用编译器:Dev C++ 5.11,搜索工具:Everything

本次比赛AH共有1252份代码,其中有21份代码未包含#include,有40份代码没有freopen,有6份代码没有main函数。

共有380人参赛,平均每人写了3.2953.295份代码。

文件大小超过10MB的有38个,其中在第一题number.cpp的有16个。

读前提醒

  • 如您对本文有任何疑问或建议,请您联系作者X沙兴安A

  • 由于Dev C++的编码格式为ANSI,在打开代码中含有的中文内容时会乱码,故中文的精辟内容可能会被忽略。

  • 希望博客封面的图片您能喜欢。

  • 祝您拥有良好的阅读体验。

精彩内容预告

  • (编号 01)1138511385句 //CCF n**l

  • (编号 05)翻译《世末歌者》人

  • (编号 11)自我介绍人

  • (编号 14)注释了,但没有完全注释人+1145*4人+大型分数运算现场

正篇

  1. 文件大小最高排名中:

第一名文件大小为33,87733,877KB

第一名文件名不是number.cpp的大小为123123KB,内容包含了1138511385句//CCF n**l,同时此位选手的其他代码中还有:

C++
//CCF n**l
//I f**k CCF's m****r
//CCF 臭****著
//感谢你送我退役
  1. 注释人

1.PNG

2.PNG

  1. a+ba+b 人
C++
#include<bits/stdc++.h>
using namespace std;
inline int read(){
  int sum=0;char ch=getchar();while(ch<'0'||ch>'9')ch=getchar();
  while(ch>='0'&&ch<='9')sum=sum*10+ch-48,ch=getchar();
  return sum;
}
int main(){
	freopen("chess.in","r",stdin);
	freopen("chess.out","w",stdout);
	int a,b;
	a=read();b=read();
	cout<<a+b<<endl;
	return 0;
}
  1. 输入到输出人

3.PNG

  1. 翻译《世末歌者》人
C++
    //Singer of the End

    //Summer's rain,becomes light ink coloring the evening.
    //Spreading,draw the footprint and car-print.
    //Laughter gets full with the floating steam.
    //Through the window,get unclear with the city.
    //Tapping the old guitar,singing the song with four beats.
    //In the memory,the single one seemed to be relaxed.
    //Waiting the temperature of the cold rain, to get rid of the nervousness and hotness.
    //Looking, for the wind(/waind/) of the wind(/wind/).
    //Still,I'm waiting at the wet,dark and lonely place.
    //Accompanied by the rain,I'm singing a song with no one listening.
    //The crowd is still going to the determinations,aimlessly.
    //Occupiedly,meaninglessly,continue.
    //I'm waiting for someone who can lightly knock my heart.
    //Even it's you,you have just stood for a single moment.
    //Thinking that maybe someone would be met at the next crossing.
    //Even , it's only a miracle for a blink.

    //In the summer's sky at night ,showed up the distant memory.
    //Blowing firecrackers were being with the Milky Way.
    //Before disappearance,I would do the softest give.
    //Just like those unclear shadows' leaving.
    //Confusedly,limited,like the fish in the city's pond.
    //Whispering,crying,are all brought into the bubbles.
    //Dragging the tired body,sink down to the freezing bottom.
    //Looking the color disappears gradually.
    //Still,I'm waiting at the wet,dark and lonely place.
    //Accompanied by the rain,I'm singing a song with no one listening.
    //The crowd is still going to the determinations,aimlessly.
    //Occupied,meaninglessly,continue.
    //Begging that someone could knock my heart softly.
    //Today's you,will be always trying to get close to me?
    //Because maybe the end of the next crossing would be the same.
    //There is no miracle lasting for a second.

    //Nights and days forever,
    //Separating and getting together,
    //Heart-beat and breath,
    //Looking for the meaning.

    //Still,I'm waiting at the wet,dark and lonely place.
    //Accompanied by the rain,singing the song that sales badly.
    //Floating people are also struggling to survive.
    //Seeking,dreaming,to continue.
    //Please don't let me climbing in the heavy end rain singly.
    //Accompanied by the rain,singing the song symbolizing the End.
    //Finally,people stop looking for and stand like being stuck.
    //Crying,begging for the miracle.
    //I'll play the destroyed sound with my pair of hands.
    //In the rain,meeting the wall of the rain silently.
    //At the end of the song,will you reply to my string's voice?
    //Holding the shrinking hands,and meet the end of everyone.
  1. 如你所愿

8.PNG

  1. 文明人(部分内容已手动打码)
C++
#include "cstdio"
using namespace std;
int main (){
    freopen("chess.in","r",stdin);
    freopen("chess.out","w",stdout);
    while (1) puts("CCF N**L!!!,I will k**l you in the future.")
    /*
    My Luogu id is 3*****9.
    name:Z****T
    QQ:3********2
    NOIP RP+=inf;
    I love TYT forever.
    That's all, thank you for your reading.
    */
    return 0;
}
C++
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m;
inline ll read(){
	...
}
inline void dfs(){
	//F**k CCF!
	return;
}
int main(){
	freopen("sequence.in","r",stdin);
	freopen("sequence.out","w",stdout);
	printf("40");	
}
//F**k your m****r,CCF!
C++
#include<bits/stdc++.h>
#define CCF_n**l_f**k_you 1
using namespace std;
inline void read(int &x) {
	...
}
int T,n,m,q;
int main() {
	freopen("chess.in","r",stdin);
	freopen("chess.out","w",stdout);
	for(read(T);T;T--) {
		read(n),read(m),read(q);
		if(n==3||m==3||q==5) {
			cout<<q-1<<endl;
			for(int i=1;i<=(q+1)/2;i++)
				cout<<q-2<<endl;
			cout<<(q-1)/2;
		}
		else
			while(CCF_n**l_f**k_you)
				puts("CCF,n**l!!!F**k you!!!");
	}
	return 0;
}
  1. qwq,qaq人

4.PNG

5.PNG

  1. sto,orz人
C++
// author tearing
// Wuhu No 1 High School
// ...
// 0pts Solution.

#include <bits/stdc++.h>
using namespace std;
const int N = 2e5+10;
string s[N];
int n, m, k;

void solve() {
  return ;
}

int main() {
  freopen("chess.in", "r", stdin);
  freopen("chess.out", "w", stdout);
  int t;
  while (t--) {
    solve();
  }
  return 0;
}

// sto syk orz
// sto zzr orz
// sto cftm orz
// sto demoe orz
// sto tjx orz
// sto cyx orz
// sto rx orz
// sto hhx orz
  1. rand人

6.PNG

  1. 自我介绍人
C++
/*
This is AH-0***,also called ??? in luogu.
And this is NOIP 2021,my last informatic competition.
Right now,I'm AFOing.Enjoy the last period.
Good luck to myself!x** NOIP 2021 rp++!
Ending is for better starting.
Thanks for all supporters,including teachers,classmates,parents and myself.
*/

Good luck!

  1. 输样例人+可怜人

7.PNG

  1. ((文明人++可怜人)×2)\times2
C++
#include <cstdio>
int main() {
	freopen("chess.in","r",stdin);
	freopen("chess.out","w",stdout); 
	puts("I can't solve this problem too!");
	puts("So let's k**l CCF together!!!");
	return 0;
}
  1. 注释了,但没有完全注释人+1145*4人+大型分数运算现场
C++
#include<iostream>
#include<fstream>
using namespace std;
int a[1005],b[1005],n,minn=0x7fffffff;
struct fr{
	int son,mum;
};
fr huajian(fr x){
	int r=max(x.son,x.mum);
	fr k=x;
	for(int i=2;i*i<=r;i++){
		while(k.son%i==0 && k.mum%i==0){
			k.son=k.son/i;
			k.mum=k.mum/i;
		}
	}
	return k;
}
fr jia(fr x,fr y){
	fr s;
	s.son=(x.son*y.mum+x.mum*y.son);
	s.mum=x.mum*y.mum;
	return s;
}
fr jian(fr x,fr y){
	fr s;
	s.son=(x.son*y.mum-x.mum*y.son);
	s.mum=x.mum*y.mum;
	return s;
}
fr jianz(int x,fr y){
	fr p;
	p.son=x,p.mum=1;
	return jian(p,y);
}
fr cheng(fr x,fr y){
	fr s;
	s.son=x.son*y.son;
	s.mum=x.mum*y.mum;
	return s;
}
fr pingfang(fr x){
	return cheng(x,x);
}
fr fc(){
	fr sum,summ,p;
	sum.son=b[1]+b[2]+b[3]+b[4];
	sum.mum=4;
	p.son=1,p.mum=4;
	summ=cheng(p,jia(jia(pingfang(jianz(b[1],sum)),pingfang(jianz(b[2],sum))),jia(pingfang(jianz(b[3],sum)),pingfang(jianz(b[4],sum)))));
	return huajian(summ);
}
int js(){
	fr g=fc();
	return g.son*n*n/g.mum;
}
int main(){
	//freopen("variance.in","r",stdin);
	//freopen("variance.out","w",stdout);
	ifstream fin("variance.in");
	ofstream fout("variance.out");
	fin>>n;
	for(int i=1;i<=n;i++){
		fin>>a[i];
	}
	if(n==4){
		b[1]=a[1],b[4]=a[4];
		b[2]=a[2],b[3]=a[3];
		minn=js();
		b[2]=a[1]+a[3]-a[2],b[3]=a[3];
		minn=min(js(),minn);
		b[2]=a[2],b[3]=a[2]+a[4]-a[3];
		minn=min(js(),minn);
		b[2]=a[1]+a[3]-a[2],b[3]=a[1]-a[2]+a[4];
		minn=min(js(),minn);
		b[2]=a[1]+a[4]-a[3],b[3]=a[2]+a[4]-a[3];
		minn=min(js(),minn);
		fout<<minn;
	}else{
		fout<<114514<<endl;
	}
	//fclose(stdin);
	//fclose(stdout);
	fin.close();
	fout.close();
	return 0;
}

附

  • 如果您的代码在上述中被提及,可以申请撤下您的代码。

  • 如果上述代码中存在个人信息泄露情况,请立即联系作者。

原文
存档评论11 条抓取于