跳到正文

算法·理论

最是一年春好处,我们继续测快读。

__CrossBow_EXE__约 47 分钟
原文
文章信息与版本

文章信息

发布
2025年4月28日
收录
2025年12月12日
更新
2026年9月25日
篇幅
约 47 分钟

版本

  1. v1当前

前言

上次测评,还是在上次。

本次,我们又邀请了新的 22 名选手,共 1515 名。有请它们出场:

编号简介
11普通 cin,cout
22普通 scanf,printf
33解绑 cin,cout
44cin.tie(0),cout.tie(0)
55解绑+tie(0)
66普通快读
77位运算优化快读
88inline 优化快读
99fread,fwrite
1010buf 读 string
1111mmap(洛谷上可用)
1212unlocked()(洛谷上可用)
1313fread 读 char 数组(上次那个“同学做的 IO”)
1414c++自带的 read
1515streambuf 读 char 数组(上次那个“同学声称超级快的快读”)

这次我依然自己制作了题目,为了省空间只造了一个测试点。

题目链接

依旧是经典的 5s5s 和 512MB512MB,每人 33 次机会。

下面给出每名选手的代码。

代码

11 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
int main(){
	cin>>n;
	for(int i=1,x;i<=n;i++){
		cin>>x;
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

22 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
int main(){
	scanf("%d",&n);
	for(int i=1,x;i<=n;i++){
		scanf("%d",&x);
		ans^=x;
	}
	printf("%d\n",ans);
	return 0;
}

33号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
int main(){
	ios::sync_with_stdio(0);
	cin>>n;
	for(int i=1,x;i<=n;i++){
		cin>>x;
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

44号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
int main(){
	cin.tie(0),cout.tie(0);
	cin>>n;
	for(int i=1,x;i<=n;i++){
		cin>>x;
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

55 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin>>n;
	for(int i=1,x;i<=n;i++){
		cin>>x;
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

66 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
int read(){
    int k=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9'){
        if(c=='-') f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9') k=k*10+c-'0',c=getchar();
    return k*f;
}
int main(){
	n=read();
	for(int i=1,x;i<=n;i++){
		x=read();
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

77 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
int read(){
	int x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
int main(){
	n=read();
	for(int i=1,x;i<=n;i++){
		x=read();
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

88 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
inline int read(){
	int x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=x*10+ch-'0';
		ch=getchar();
	}
	return x*f;
}
int main(){
	n=read();
	for(int i=1,x;i<=n;i++){
		x=read();
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

99 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
const int BUFSIZE=1<<20;
char ibuf[BUFSIZE],*is=ibuf,*it=ibuf;
inline char getch(){if(is==it)it=(is=ibuf)+fread(ibuf,1,BUFSIZE,stdin);return is==it?EOF:*is++;}
char tmp[BUFSIZE];int cnt=0;
int read(){
	int x=0,f=1;
	char ch=getch();
	while(!isdigit(ch)){
		if(ch=='-') f=-1;
		ch=getch();
	}
	while(isdigit(ch)){
		x=x*10+ch-'0';
		ch=getch();
	}
	return x*f;
}
int main(){
	n=read();
	for(int i=1,x;i<=n;i++){
		x=read();
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

1010 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
namespace Fast_I{
	char *_Buf,*_Start_ptr,*_End_ptr;
	streambuf *inbuf;
	unsigned int Size;
	bool _Ok;
	struct Fast_Istream{
		operator bool(){return _Ok;}
		Fast_Istream(streambuf *in,unsigned int Sz){
			_Ok=1;
			Fast_I::Size=Sz;
			inbuf=in;
			_Start_ptr=_End_ptr=_Buf=new char[Sz];
		}
		Fast_Istream(const char *in,unsigned int Sz){
			_Ok=1;
			Fast_I::Size=Sz;
			rdbuf(in);
			_Start_ptr=_End_ptr=_Buf=new char[Sz];
		}
		Fast_Istream(unsigned int Sz){
			_Ok=1;
			Fast_I::Size=Sz;
			_Start_ptr=_End_ptr=_Buf=new char[Sz];
		}
		void rdbuf(const char *File){
			static ifstream __In__(File);
			rdbuf(__In__.rdbuf());
		}
		void Get_Char(char &_Val){
			if(_Start_ptr==_End_ptr){
				_Start_ptr=_Buf;
				_End_ptr=_Buf+inbuf->sgetn(_Buf,Size);
			}
			if(_Start_ptr==_End_ptr){
				_Val=-1;
				_Ok=0;
			}else _Val=*_Start_ptr++;
		}
		Fast_Istream &operator>>(char &_Val){
			if(_Ok){
				Get_Char(_Val);
				while(_Val==32||_Val==10||_Val==13||_Val==8||_Val==9||_Val==7||_Val==12||_Val==11) Get_Char(_Val);
			}
			return *this;
		}
		Fast_Istream &operator>>(char *_Val){
			if(_Ok){
				Get_Char(*_Val);
				while(*_Val==32||*_Val==10||*_Val==13||*_Val==8||*_Val==9||*_Val==7||*_Val==12||*_Val==11) Get_Char(*_Val);
				while(*_Val!=32&&*_Val!=10&&*_Val&&*_Val!=-1&&*_Val!=9 &&*_Val!=11&&*_Val!=12&&~*_Val) Get_Char(*++_Val);
				*_Val=0;
				--_Start_ptr;
			}
			return *this;
		}
		Fast_Istream &operator>>(string &_Val){
			if(_Ok){
				char c;
				Get_Char(c);
				while(c==32||c==10||c==13||c==8||c==9||c==7||c==12||c==11) Get_Char(c);
				for(_Val.clear();c!=32&&c!=10&&c&&c!=-1&&c!=9&&c!=11&&c!=12&&~c;Get_Char(c)) _Val.push_back(c);
				--_Start_ptr;
			}
			return *this;
		}
		template <typename Typex>
		void Get_Int(Typex &_Val){
			if(_Ok){
				char ch;
				bool _F=0;
				for(Get_Char(ch);(ch<48||ch>57)&&~ch;Get_Char(ch)) _F=ch==45;
				for(_Val=0;ch>47&&ch<58&&~ch;Get_Char(ch)) _Val=_Val*10+(ch^48);
				if(_F) _Val=~_Val+1;
				--_Start_ptr;
			}
		}
		template <typename Typex>
		void Get_Unsigned(Typex &_Val){
			if(_Ok){
				char ch;
				Get_Char(ch);
				while((ch<48||ch>57)&&~ch) Get_Char(ch);
				for(_Val=0;ch>47&&ch<58&&~ch;Get_Char(ch)) _Val=_Val*10+(ch^48);
				--_Start_ptr;
			}
		}
		template <typename Typex>
		void Get_Double(Typex &_Val){
			if(_Ok){
				char ch;
				bool _F=0;
				for(Get_Char(ch);(ch<48||ch>57)&&~ch;Get_Char(ch)) _F=ch==45;
				for(_Val=0;ch>47&&ch<58&&~ch;Get_Char(ch)) _Val=_Val*10+(ch^48);
				if(ch==46){
					unsigned long long _Pow=1;
					for(Get_Char(ch);ch>47&&ch<58&&~ch;Get_Char(ch)) _Val+=Typex((ch^48)*1.0/(_Pow*=10));
				}
				if(_F) _Val=-_Val;
				--_Start_ptr;
			}
		}
		Fast_Istream &operator>>(bool &_Val){
			if(_Ok){
				char ch;
				Get_Char(ch);
				while(ch==32||ch==10||ch==13||ch==8||ch==9||ch==7||ch==12||ch==11) Get_Char(ch);
				while(ch!=32&&ch!=10&&ch&&~ch&&ch!=9&&ch!=11&&ch!=12&&~ch){
					_Val|=ch!=48;
					Get_Char(ch);
				}
				--_Start_ptr;
			}
			return *this;
		}
		Fast_Istream &operator>>(short &_Val){
			Get_Int(_Val);
			return *this;
		}
		Fast_Istream &operator>>(int &_Val){
			Get_Int(_Val);
			return *this;
		}
		Fast_Istream &operator>>(long &_Val){
			Get_Int(_Val);
			return *this;
		}
		Fast_Istream &operator>>(long long &_Val){
			Get_Int(_Val);
			return *this;
		}
		Fast_Istream &operator>>(unsigned short &_Val){
			Get_Unsigned(_Val);
			return *this;
		}
		Fast_Istream &operator>>(unsigned int &_Val){
			Get_Unsigned(_Val);
			return *this;
		}
		Fast_Istream &operator>>(unsigned long &_Val){
			Get_Unsigned(_Val);
			return *this;
		}
		Fast_Istream &operator>>(unsigned long long &_Val){
			Get_Unsigned(_Val);
			return *this;
		}
		Fast_Istream &operator>>(float &_Val){
			Get_Double(_Val);
			return *this;
		}
		Fast_Istream &operator>>(double &_Val){
			Get_Double(_Val);
			return *this;
		}
		Fast_Istream &operator>>(long double &_Val){
			Get_Double(_Val);
			return *this;
		}
		template <typename Typex,typename... More>
		void operator()(Typex &_Val,More &... _More){
			*this>>_Val;
			operator()(_More...);
		}
		void pop(){
			char ch;
			Get_Char(ch);
		}
		char peek(){
			if(_Start_ptr==_End_ptr){
				_Start_ptr=_Buf;
				_End_ptr=_Buf+inbuf->sgetn(_Buf,Size);
			}
			if(_Start_ptr==_End_ptr){
				_Ok=0;
				return -1;
			}else return *_Start_ptr;
		}
		template <typename Typex>
		void operator()(Typex &_Val){*this>>_Val;}
		template <typename Typex,typename...More>
		streambuf *rdbuf(){return inbuf;}
		void rdbuf(streambuf *_inbuf){inbuf=_inbuf;}
		Fast_Istream getline(string &s,char _End='\n'){
			if(_Ok){
				char c;
				Get_Char(c);
				while((c==32||c==10||c==13||c==8||c==9||c==7||c==12||c==11||c==-1)&&c!=_End) Get_Char(c);
				for(s.clear();c!=_End&&~c;Get_Char(c)) s.push_back(c);
				--_Start_ptr;
			}
			return *this;
		}
	};
}
//快写
namespace Fast_O{
	string buf;
	streambuf *outbuf;
	int _M_precision=6;
	struct Fast_Ostream{
		Fast_Ostream(streambuf *out,unsigned int Size){
			buf.reserve(Size);
			outbuf=out;
		}
		Fast_Ostream(std::streambuf* out){outbuf=out;}
		Fast_Ostream(const char *File,unsigned int Size){
			buf.reserve(Size);
			rdbuf(File);
		}
		void rdbuf(const char *File){
			static ofstream __Out__(File);
			rdbuf(__Out__.rdbuf());
		}
		Fast_Ostream(unsigned int Size){buf.reserve(Size);}
		void flush(){
			outbuf->sputn(buf.data(),buf.size());
			buf.clear();
		}
		~Fast_Ostream(){flush();}
		void endl(){buf.push_back('\n');}
		Fast_Ostream &operator<<(char _Val){
			buf.push_back(_Val);
			return *this;
		}
		Fast_Ostream &operator<<(const char *_Val){
			while(*_Val) buf.push_back(*_Val++);
			return *this;
		}
		Fast_Ostream &operator<<(const string &_Val){
			buf+=_Val;
			return *this;
		}
		template <typename Typex>
		void Put_Unsigned(Typex _Val){
			char *_Stack=(char *)malloc(sizeof(Typex)*3);
			unsigned S_top=0;
			while(_Val){
				_Stack[++S_top]=(_Val%10)^48;
				_Val/=10;
			}
			if(!S_top) buf.push_back('0');
			while(S_top) buf.push_back(_Stack[S_top--]);
			free(_Stack);
		}
		template <typename Typex>
		void Put_Int(Typex _Val){
			if(_Val<0){
				buf.push_back('-');
				Put_Unsigned(~_Val+1);
			}else Put_Unsigned(_Val);
		}
		Fast_Ostream &operator<<(bool _Val){
			buf.push_back(_Val?'1':'0');
			return *this;
		}
		Fast_Ostream &operator<<(short _Val){
			Put_Int(_Val);
			return *this;
		}
		Fast_Ostream &operator<<(int _Val){
			Put_Int(_Val);
			return *this;
		}
		Fast_Ostream &operator<<(long _Val){
			Put_Int(_Val);
			return *this;
		}
		Fast_Ostream &operator<<(long long _Val){
			Put_Int(_Val);
			return *this;
		}
		Fast_Ostream &operator<<(unsigned short _Val){
			Put_Unsigned(_Val);
			return *this;
		}
		Fast_Ostream &operator<<(unsigned int _Val){
			Put_Unsigned(_Val);
			return *this;
		}
		Fast_Ostream &operator<<(unsigned long _Val){
			Put_Unsigned(_Val);
			return *this;
		}
		Fast_Ostream &operator<<(unsigned long long _Val){
			Put_Unsigned(_Val);
			return *this;
		}
		template <typename Typex>
		void endl(const Typex &_Val){*this<<_Val<<'\n';}
		template <typename Typex,typename... More>
		void endl(const Typex &_Val,const More &... _More){
			*this<<_Val;
			endl(_More...);
		}
		template <typename Typex>
		void operator()(const Typex &_Val){*this<<_Val;}
		template <typename Typex,typename... More>
		void operator()(const Typex &_Val,const More &... _More){
			*this<<_Val;
			operator()(_More...);
		}
		std::streambuf *rdbuf(){return outbuf;}
		void rdbuf(std::streambuf *_outbuf){outbuf=_outbuf;}
	};
}
namespace Fast_IO{
	Fast_I::Fast_Istream fin(cin.rdbuf(),16777216);
	Fast_O::Fast_Ostream fout(cout.rdbuf());
}
using namespace Fast_IO;
int main(){
	fin>>n;
	for(int i=1,x;i<=n;i++){
		fin>>x;
		ans^=x;
	}
	fout<<ans<<'\n';
	return 0;
}

1111 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
char *pc;
int rd(){
    int x=0,f=1;
    char c=*pc++;
    while(!isdigit(c)){
        if(c=='-') f=-1;
        c=*pc++;
    }
    while(isdigit(c)) x=x*10+c-'0',c=*pc++;
    return x*f;
}
int main(){
	int fd=0;
	struct stat state;
	fstat(fd,&state);
	pc=(char*)mmap(NULL,state.st_size,PROT_READ,MAP_PRIVATE,fd,0);
	close(fd);
	n=rd();
	for(int i=1,x;i<=n;i++){
		x=rd();
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

1212 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
int read(){
	int num=0,f=1;char c=getchar_unlocked();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar_unlocked();}
	while(c>='0'&&c<='9'){num=num*10+(c-'0');c=getchar_unlocked();}
	return num*f;
}
int main(){
	n=read();
	for(int i=1,x;i<=n;i++){
		x=read();
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

1313 号选手

C++
#include<bits/stdc++.h>
using namespace std;
int n;
int ans;
#define MAXSIZE (1<<20) 
#define isdigit(x) ( x >= '0' && x <= '9' ) 
#define blank(x) ( x == ' ' || x == '\n' || x == '\r' || x == '\t' )
#define Setprecision 6
namespace Fread {
	char buf[MAXSIZE] ,*p1,*p2 ;//输入缓冲区优化(Fread命名空间)
	inline char getchar () { if (p1 == p2) p2 = (p1 = buf) + fread(buf , 1 , MAXSIZE , stdin) ; return p1 == p2 ? '\n' : *p1++ ; }//定义getchar()
}
namespace Fwrite {//输出缓冲区优化(Fwrite命名空间)
	char buf[MAXSIZE],*p1 = buf , *p2 = buf + MAXSIZE ;
	inline void flush () { fwrite(buf, 1, p1 - buf, stdout); p1 = buf; }
	inline void putchar (char c) { *p1++ = c; if (p1 == p2) flush(); }//定义putchar() 
	struct NTR { ~NTR() { flush(); } } ztr;// 程序结束时自动刷新
}
using namespace Fread ;
using namespace Fwrite ;
#define getchar Fread::getchar
#define putchar Fwrite::putchar
namespace IO 
{
	struct Reader //Reader类(重载>>运算符)
	{
		template <typename T> Reader& operator >> (T &x) //int ,long long ,long ,__int128
		{
			x = 0 ; short f = 1 ;char c = getchar() ;
			while ( !isdigit(c) ) {if (c == '-') { f = -1 ; } c = getchar() ; }
			while ( isdigit(c) ) x = (x << 3) + (x << 1) + (c ^ 48) , c = getchar() ;
			x *= f ;
			return *this ;
		}
		Reader& operator >> (double &x)//double
		{
			x = 0 ; double t = 0 ; short f = 1 , s = 0 ; char c = getchar() ;
			while ( (!isdigit(c)) && c != '.' ) {if (c == '-') { f = -1 ; } c = getchar() ; }
			while ( (isdigit(c)) && c != '.' ) x = (x * 10) + (c ^ 48) , c = getchar() ;
			if (c == '.') c = getchar() ;
			else { x *= f ; return *this ; }
			while (isdigit(c)) t = t * 10 + (c ^ 48) , s++ , c = getchar() ;
			while (s--) t /= 10.0 ;
			x = (x + t) * f ;
			return *this ;
		}
		Reader& operator >> (long double &x)//long double
		{
			x = 0 ; long double t = 0 ; short f = 1 , s = 0 ; char c = getchar() ;
			while ( (!isdigit(c)) && c != '.') { if (c == '-') { f = -1 ; } c = getchar() ; }
			while ( (isdigit(c)) && c != '.' ) x = (x * 10) + (c ^ 48) , c = getchar() ;
			if (c == '.') c = getchar() ;
			else { x *= f ; return *this ; }
			while (isdigit(c)) t = t * 10 + (c ^ 48) , s++ , c = getchar() ;
			while (s--) t /= 10.0 ;
			x = (x + t) * f ;
			return *this ;
		}
		Reader& operator >> (__float128 &x)//__float128
		{
			x = 0 ; __float128 t = 0 ; short f = 1 , s = 0 ; char c = getchar() ;
			while ( (!isdigit(c)) && c != '.') { if (c == '-') { f = -1 ; } c = getchar() ; }
			while ( (isdigit(c)) && c != '.' ) x = (x * 10) + (c ^ 48) , c = getchar() ;
			if (c == '.') c = getchar() ;
			else { x *= f ; return *this ; }
			while (isdigit(c)) t = t * 10 + (c ^ 48) , s++ , c = getchar() ;
			while (s--) t /= 10.0 ;
			x = (x + t) * f ;
			return *this ;
		}
		Reader& operator >> (char &c)//char
		{
			c = getchar() ;
			while ( blank(c) ) c = getchar() ;
			return *this ;
		}
		Reader& operator >> (char *str)//char[]
		{
			int len = 0;
			char c = getchar() ;
			while ( blank(c) ) c = getchar() ;
			while ( !blank(c) ) str[len++] = c , c = getchar() ;
			str[len] = '\0' ;
			return *this ;
		}
		Reader& operator >> (string &str)//string
		{
			str.clear() ;
			char c = getchar() ;
			while ( blank(c) ) c = getchar() ;
			while ( !blank(c) ) str.push_back(c) , c = getchar() ;
			return *this ;
		}
		Reader() {}
	}cin;
	const char endl = '\n' ;//endl -> '\n'
	struct Writer//Writer类(重载<<运算符)
	{
		typedef int mxdouble ;
		template <typename T> Writer& operator << (T x)//int ,long long ,long ,__int128
		{
			if (x == 0) { putchar('0') ; return *this; }
			if (x < 0) putchar('-') , x = -x ;
			static short sta[40] ;
			short top = 0 ;
			while (x > 0) sta[++top] = x % 10 , x /= 10 ;
			while (top > 0) putchar(sta[top] + '0') , top-- ;
			return *this ;
		}
		Writer& operator << (double x)//double
		{
			if (x < 0) putchar('-') , x = -x ;
			mxdouble _ = x;
			x -= (double)_;
			static short sta[40] ;
			short top = 0 ;
			while (_ > 0) sta[++top] = _ % 10 , _ /= 10 ;
			if (top == 0) putchar('0') ;
			while (top > 0) putchar(sta[top] + '0'), top-- ;
			putchar('.') ;
			for (int i = 0 ; i < Setprecision; i++) x *= 10 ;
			_ = x;
			while (_ > 0) sta[++top] = _ % 10 , _ /= 10 ;
			for (int i = 0 ; i < Setprecision - top ; i++) putchar('0') ;
			while (top > 0) putchar(sta[top] + '0') , top-- ;
			return *this ;
		}
		Writer& operator << (long double x)//long double
		{
			if (x < 0) putchar('-') , x = -x ;
			mxdouble _ = x ;
			x -= (long double)_ ;
			static short sta[40] ;
			short top = 0 ;
			while (_ > 0) sta[++top] = _ % 10 , _ /= 10 ;
			if (top == 0) putchar('0') ;
			while (top > 0) putchar(sta[top] + '0') , top-- ;
			putchar('.');
			for (int i = 0 ; i < Setprecision ; i++) x *= 10 ;
			_ = x ;
			while (_ > 0) sta[++top] = _ % 10 , _ /= 10 ;
			for (int i = 0 ; i < Setprecision - top ; i++) putchar('0') ;
			while (top > 0) putchar(sta[top] + '0') , top-- ;
			return *this ;
		}
		Writer& operator << (__float128 x)//__float128
		{
			if (x < 0) putchar('-') , x = -x ;
			mxdouble _ = x ;
			x -= (__float128)_ ;
			static short sta[40] ;
			short top = 0;
			while (_ > 0) sta[++top] = _ % 10 , _ /= 10 ;
			if (top == 0) putchar('0') ;
			while (top > 0) putchar(sta[top] + '0'), top-- ;
			putchar('.') ;
			for (int i = 0 ; i < Setprecision ; i++) x *= 10 ;
			_ =  x;
			while (_ > 0) sta[++top] = _ % 10 , _ /= 10 ;
			for (int i = 0 ; i < Setprecision - top; i++) putchar('0') ;
			while (top > 0) putchar(sta[top] + '0') , top-- ;
			return *this ;
		}
		Writer& operator << (char c) { putchar(c) ; return *this ; }//char
		Writer& operator << (char *str)//char[]
		{
			int cur = 0 ;
			while (str[cur]) putchar(str[cur++]) ;
			return *this ;
		}
		Writer& operator << (const char *str)
		{
			int cur = 0 ;
			while (str[cur]) putchar(str[cur++]) ;
			return *this ;
		}
		Writer& operator << (string str)//string
		{
			int st = 0, ed = str.size() ;
			while (st < ed) putchar(str[st++]) ;
			return *this ;
		}
		Writer() {}
	}cout;
}
using namespace IO;
#define cin IO::cin
#define cout IO::cout
#define endl IO::endl 
int main(){
	cin>>n;
	for(int i=1,x;i<=n;i++){
		cin>>x;
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

1414 号选手

C++
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
int n;
int ans;
char buffer[32769];
unsigned li=0;
int fastread(){
    char ch;
    do{
        read(0,&ch,1);
    } while(ch==' '||ch=='\n');
    int flag=(ch!='-'?1:(read(0, &ch, 1)*0+-1));
    int a=0;
    do{
        a=a*10+ch-'0';
        read(0,&ch,1);
    }while(ch>='0'&&ch<='9');
    return a*flag;
}
int main(){
	n=fastread();
	for(int i=1,x;i<=n;i++){
		x=fastread();
		ans^=x;
	}
	cout<<ans<<endl;
	return 0;
}

1515 号选手

C++
#include<bits/stdc++.h>
#define ull unsigned long long 
using namespace std;
namespace Fast_I{
	char *_Buf,*_Start_ptr,*_End_ptr,ch;
	streambuf *inbuf;
	constexpr unsigned int Size=1<<18;
	bool _F;
	struct Fast_Istream{
		Fast_Istream(streambuf *in){
			inbuf=in;
			_Start_ptr=_End_ptr=_Buf=new char[Size];
		}
		void Get_Char(char &_Val){
			if(__builtin_expect(_Start_ptr==_End_ptr,0)){
				_Start_ptr=_Buf;
				_End_ptr=_Buf+inbuf->sgetn(_Buf,Size);
				if(__builtin_expect(_Start_ptr==_End_ptr,0)){
					_Val=-1;
					return;
				}
			}
			_Val=*_Start_ptr++;
		}
		void Get_Unsigned(ull &_Val){
			Get_Char(ch);
			for(_Val=0;ch>47&&ch<58;Get_Char(ch)){
				_Val=_Val*10+(ch^48);
			}
		}
		Fast_Istream &operator>>(ull &_Val){
			Get_Unsigned(_Val);
			return *this;
		}
        void GetN(ull &_Val){
            Get_Unsigned(_Val);
            _Start_ptr++;
        }
	};
}// namespace Fast_I
//快写
namespace Fast_O{
	string buf;
	streambuf *outbuf;
    char _Stack[13];
    unsigned S_top;
	struct Fast_Ostream{
		Fast_Ostream(std::streambuf* out){
			outbuf=out;
		}
		void flush(){
			outbuf->sputn(buf.data(),buf.size());
			buf.clear();
		}
		~Fast_Ostream(){
			flush();
		}
		void Put_Unsigned(ull _Val){
			S_top=0;
			while(_Val){
				_Stack[++S_top]=(_Val%10)^48;
				_Val/=10;
			}
			if(!S_top){
				buf+='0';
			}
			while(S_top){
				buf+=_Stack[S_top--];
			}
		}
		Fast_Ostream &operator<<(ull _Val){
			Put_Unsigned(_Val);
			return *this;
		}
	};
}
namespace Fast_IO{
	Fast_I::Fast_Istream fin(cin.rdbuf());
	Fast_O::Fast_Ostream fout(cout.rdbuf());
}
#define fin Fast_IO::fin
#define fout Fast_IO::fout
ull s,n,a;
int main(){
	fin.GetN(n);
	for(int i=1;i<=n;i++){
		fin>>a;
		s^=a;
	}
	fout<<s;
	return 0;
}

测试

11 号选手

测试编号总用时(ms)
1129702970
2229602960
3329602960

22 号选手

测试编号总用时(ms)
1110601060
2210501050
3310501050

33 号选手

测试编号总用时(ms)
11890890
22887887
33912912

44 号选手

测试编号总用时(ms)
1128702870
2228802880
3328802880

55 号选手

测试编号总用时(ms)
11837837
22830830
33855855

66 号选手

测试编号总用时(ms)
11343343
22343343
33344344

77 号选手

测试编号总用时(ms)
11338338
22338338
33339339

88 号选手

测试编号总用时(ms)
11307307
22309309
33306306

99 号选手

测试编号总用时(ms)
11130130
22130130
33130130

1010 号选手

测试编号总用时(ms)
11164164
22163163
33163163

1111 号选手

测试编号总用时(ms)
119191
229090
339292

1212 号选手

测试编号总用时(ms)
11156156
22155155
33157157

1313 号选手

测试编号总用时(ms)
11115115
22113113
33115115

1414 号选手

测试编号总用时(ms)
11TLE
22TLE
33TLE

1515 号选手

测试编号总用时(ms)
11116116
22116116
33117117

结算

RankNameTime(ms)
11mmap9191
22fread 读 char 数组114114
33streambuf 读 char 数组116116
44fread,fwrite130130
55unlocked()156156
66buf 读 string163163
77inline 优化快读307307
88位运算优化快读338338
99普通快读343343
1010解绑+tie(0)840840
1111解绑 cin,cout896896
1212普通 scanf,printf10531053
1313tie(0)28732873
1414普通 cin,cout29632963
1515C++自带的 readTLE
  • mmap 牛逼!mmap 好闪,拜谢 mmap
  • 前几名稳定发挥,没什么好说的
  • 快读家族排到一起了?
  • 解绑+tie(0) 依然性价比很高
  • 最后一名认真的?

我们每 55 名一分组:(最后一名算 5s5s)

组别平均用时(ms)
AA121121
BB398398
CC25572557

感谢你的观看!(下面依旧有隐藏字!)

总是有人问我,哎呀CEXE\color{white}总是有人问我,哎呀 CEXE 你为什么总是出毒瘤模拟赛?那我问你:\color{white}你为什么总是出毒瘤模拟赛?那我问你: 我不出模拟赛我会不会没事干?\color{white}我不出模拟赛我会不会没事干? 我们不做模拟赛会不会保龄?\color{white}我们不做模拟赛会不会保龄? 回答我!\color{white}回答我! Lookinmyeyes!\color{white}Look in my eyes! Tellme!\color{white}Tell me! Whywhybabywhy\color{white}Why why baby why 没事干会不会就去颓?\color{white}没事干会不会就去颓? 嗯?\color{white}嗯? 你回答我\color{white}你回答我
原文
存档评论1 条抓取于