跳到正文

个人记录

快读

jackhe1约 22 分钟
原文
文章信息与版本

文章信息

发布
2026年10月6日
收录
2026年10月6日
更新
2026年11月13日
篇幅
约 22 分钟
获赞
1

版本

  1. v2当前
  2. v1
C++
#include<bits/stdc++.h>
using namespace std;
#define cin IO::fin
#define cout IO::fout
namespace IO {
	char buf[1<<20],*is=buf,*ed=buf,ot[1<<20],tmp[50];
	const char min32[]="-2147483648";
	const char min64[]="-4611686018427387904";
	const char min128[]="-339015474820318638148614395449002950656";
	int cnt=0,fh,len;
	__int128 m128=-339015474820318638148614395449002950656;
	char ch() {
		if(is==ed)ed=(is=buf)+fread(buf,1,(1<<20),stdin);
		return is==ed?EOF:*is++;
	}
	void flush() {
		fwrite(ot,1,cnt,stdout);
		cnt=0;
	}
	void putch(char c) {
		ot[cnt++]=c;
		if(cnt==(1<<20))flush();
	}
	__int128 read_int128() {
		__int128 f=1,h=0;
		char s='\0';
		for(; !isdigit(s)&&s!=EOF;) {
			if(s=='-')f=-1;
			s=ch();
		}
		for(; isdigit(s)&&s!=EOF;) {
			h=(h<<3)+(h<<1)+(s^48);
			s=ch();
		}
		return f*h;
	}
	long long read_long_long() {
		long long f=1,h=0;
		char s='\0';
		for(; !isdigit(s)&&s!=EOF;) {
			if(s=='-')f=-1;
			s=ch();
		}
		for(; isdigit(s)&&s!=EOF;) {
			h=(h<<3)+(h<<1)+(s^48);
			s=ch();
		}
		return f*h;
	}

	int read_int() {
		int f=1,h=0;
		char s='\0';
		for(; !isdigit(s)&&s!=EOF;) {
			if(s=='-')f=-1;
			s=ch();
		}
		for(; isdigit(s)&&s!=EOF;) {
			h=(h<<3)+(h<<1)+(s^48);
			s=ch();
		}
		return f*h;
	}
	void cp_write(const char s[],int len) {
		if(is+len<=ed) {
			memcpy(ot+cnt,s,len);
		} else {
			flush();
			memcpy(ot+cnt,s,len);
		}
	}
	void write_int128(__int128 x) {
		len=0,fh=0;
		if(x==0) {
			putch('0');
			return;
		}
		if(x==m128) {
			cp_write(min128,20);
			return ;
		}
		if(x<0) fh=1;
		for(; x;) {
			tmp[++len]=(x%10+'0');
			x/=10;
		}
		if(fh)putch('-');
		for(int i=len; i>=1; i--) {
			putch(tmp[i]);
		}
	}
	void write_long_long(long long x) {
		len=0,fh=0;
		if(x==0) {
			putch('0');
			return;
		}
		if(x==LONG_MIN) {
			cp_write(min64,20);
			return ;
		}
		if(x<0) fh=1;
		for(; x;) {
			tmp[++len]=(x%10+'0');
			x/=10;
		}
		if(fh)putch('-');
		for(int i=len; i>=1; i--) {
			putch(tmp[i]);
		}
	}
	void write_int(int x) {
		len=0,fh=0;
		if(x==0) {
			putch('0');
			return;
		}
		if(x==INT_MIN) {
			cp_write(min32,11);
			return ;
		}
		if(x<0) fh=1;
		for(; x;) {
			tmp[++len]=(x%10+'0');
			x/=10;
		}
		if(fh)putch('-');
		for(int i=len; i>=1; i--) {
			putch(tmp[i]);
		}
	}
	struct Basic {
		Basic &operator >>(__int128 &A) {
			A=IO::read_int128();
			return(*this);
		};
		Basic &operator <<(const __int128 &A) {
			IO::write_int128(A);
			return(*this);
		};
		Basic &operator >>(int &A) {
			A=IO::read_int();
			return(*this);
		};
		Basic &operator <<(const int &A) {
			IO::write_int(A);
			return(*this);
		};
		Basic &operator >>(long long &A) {
			A=IO::read_long_long();
			return(*this);
		};
		Basic &operator <<(const long long &A) {
			IO::write_long_long(A);
			return(*this);
		};
//		Basic &operator >>(long long &A){A=IO::read_long_long();return(*this);};
//		Basic &operator <<(const long long &A){IO::write_long_long(A);return(*this);};
		void Flush() {
			flush();
		}
	} fin,fout;
}
int main() {
	freopen("www.txt","w",stdout);
	int a=1<<30;
	for(int i=1; i<=10000000; i++)cout<<a;
	cout.Flush();
	return 0;
}
C++
#include<bits/stdc++.h>
using namespace std;
#define cin IO::fin
#define cout IO::fout
namespace IO {
	char buf[1<<20],*is=buf,*ed=buf,ot[1<<20],tmp[50],rs;int cnt=0,fh,len;
	__int128 m128=-339015474820318638148614395449002950656;
	inline char ch() {if(is==ed)ed=(is=buf)+fread(buf,1,(1<<20),stdin);return is==ed?EOF:*is++;}
	inline flush(){fwrite(ot,1,cnt,stdout);cnt=0;}
	inline void putch(char c) {ot[cnt++]=c;if(cnt==((1<<20)))flush();}
	inline __int128 read_int128(){
		__int128 f=1,h=0;rs='\0';
		for(; !isdigit(rs)&&rs!=EOF;){if(rs=='-')f=-1;rs=ch();}
		for(; isdigit(rs)&&rs!=EOF;){h=(h<<3)+(h<<1)+(rs^48);rs=ch();}
		return f*h;
	}
	inline long long read_long_long(){
		long long f=1,h=0;rs='\0';
		for(;!isdigit(rs)&&rs!=EOF;){if(rs=='-')f=-1;rs=ch();}
		for(;isdigit(rs)&&rs!=EOF;){h=(h<<3)+(h<<1)+(rs^48);rs=ch();}
		return f*h;
	}
	inline int read_int(){
		int f=1,h=0;rs='\0';
		for(;!isdigit(rs)&&rs!=EOF;){if(rs=='-')f=-1;rs=ch();}
		for(;isdigit(rs)&&rs!=EOF;){h=(h<<3)+(h<<1)+(rs^48);rs=ch();}
		return f*h;
	}
	inline short read_short(){
		int f=1,h=0;rs='\0';
		for(;!isdigit(rs)&&rs!=EOF;){if(rs=='-')f=-1;rs=ch();}
		for(;isdigit(rs)&&rs!=EOF;){h=(h<<3)+(h<<1)+(rs^48);rs=ch();}
		return f*h;
	}
	inline string read_string(){
		rs=ch();//去空格
		string f; 
		while((rs=ch())!=' '&&rs!='\n'){
			rs=ch();
			f=f+rs;
		}
		return f;
	}
	inline void write_int128(__int128 x) {
		len=0,fh=0;if(x==0) {putch('0');return;}
		if(x<0&&x!=-339015474820318638148614395449002950656)fh=1,x=-x;if(x==-339015474820318638148614395449002950656)fh=2;
		if(fh!=2)for(; x;)tmp[++len]=(x%10+'0'),x/=10;
		else for(;x;)tmp[++len]=((-(x%10))+'0'),x/=10;
		if(fh)putch('-');
		for(int i=len; i>=1; i--)putch(tmp[i]);
	}
	inline void write_long_long(long long x) {
		len=0,fh=0;if(x==0) {putch('0');return;}
		if(x<0&&x!=-4611686018427387904) fh=1,x=-x;if(x==-4611686018427387904)fh=2;
		if(fh!=2)for(; x;)tmp[++len]=(x%10+'0'),x/=10;
		else for(;x;)tmp[++len]=((-(x%10))+'0'),x/=10;
		if(fh)putch('-');
		for(int i=len; i>=1; i--) putch(tmp[i]);
	}
	inline void write_int(int x) {
		len=0,fh=0;if(x==0) {putch('0');return;}
		if(x<0&&x!=-2147483648)fh=1,x=-x;if(x==-2147483648)fh=2;
		if(fh!=2)for(; x;)tmp[++len]=(x%10+'0'),x/=10;
		else for(;x;)tmp[++len]=((-(x%10))+'0'),x/=10;
		if(fh)putch('-');
		for(int i=len;i>=1;i--)putch(tmp[i]);
	}
	inline void write_int(short x) {
		len=0,fh=0;if(x==0) {putch('0');return;}
		if(x<0&&x!=-65536)fh=1,x=-x;if(x==-65536)fh=2;
		if(fh!=2)for(; x;)tmp[++len]=(x%10+'0'),x/=10;
		else for(;x;)tmp[++len]=((-(x%10))+'0'),x/=10;
		if(fh)putch('-');
		for(int i=len;i>=1;i--)putch(tmp[i]);
	}
	inline void write_char(char s){putch(s);}
	inline char read_char(){return ch();}
	inline void write_string(string s){for(int i=0;i<s.size();i++)putch(s[i]);}
	inline bool read_bool(){return (bool)(ch()-'0');}
	inline void write_bool(bool x){putch((x==true?'1':'0'));}
	struct Basic {
		Basic &operator >>(int &A) {A=IO::read_int();return(*this);};
		Basic &operator >>(char &A){A=IO::read_char();return(*this);};
		Basic &operator >>(bool &A){A=IO::read_bool();return(*this);};
		Basic &operator >>(string &A){A=IO::read_string();return(*this);};
		Basic &operator >>(__int128 &A) {A=IO::read_int128();return(*this);};
		Basic &operator >>(long long &A) {A=IO::read_long_long();return(*this);};
		Basic &operator <<(const bool &A){IO::write_bool(A);return(*this);};
		Basic &operator <<(const string &A){IO::write_string(A);return(*this);};
		Basic &operator <<(const int &A) {IO::write_int(A);return(*this);};
		Basic &operator <<(const char&A){IO::write_char(A);return(*this);};
		Basic &operator <<(const __int128 &A) {IO::write_int128(A);return(*this);};
		Basic &operator <<(const long long &A) {IO::write_long_long(A);return(*this);};
		void Flush() {flush();}
	} fin,fout;
}
int main() {
//	freopen("1.in","r",stdin);
freopen("2.out","w",stdout);
//	int a=0;
//	long long sm=0;
//	for(int i=1; i<=10000000; i++){
//		cin>>a;
//		sm+=a;
//	}
//	cout<<sm<<'\n';
int a=-2147483648;
for(int i=1;i<=10000000;i++)cout<<a<<'\n';
	cout.Flush();
	return 0;
}
C++
#define cin IO::fin
#define cout IO::fout
namespace IO {
	char buf[1<<20],*is=buf,*ed=buf,ot[1<<20],tmp[50],rs;int cnt=0,fh,len;
	__int128 m128=-339015474820318638148614395449002950656;
	inline char ch() {if(is==ed)ed=(is=buf)+fread(buf,1,(1<<20),stdin);return is==ed?EOF:*is++;}
	inline flush(){fwrite(ot,1,cnt,stdout);cnt=0;}
	inline void putch(char c) {ot[cnt++]=c;if(cnt==((1<<20)))flush();}
	inline __int128 read_int128(){
		__int128 f=1,h=0;rs='\0';
		for(; !isdigit(rs)&&rs!=EOF;){if(rs=='-')f=-1;rs=ch();}
		for(; isdigit(rs)&&rs!=EOF;){h=(h<<3)+(h<<1)+(rs^48);rs=ch();}
		return f*h;
	}
	inline long long read_long_long(){
		long long f=1,h=0;rs='\0';
		for(;!isdigit(rs)&&rs!=EOF;){if(rs=='-')f=-1;rs=ch();}
		for(;isdigit(rs)&&rs!=EOF;){h=(h<<3)+(h<<1)+(rs^48);rs=ch();}
		return f*h;
	}
	inline int read_int(){
		int f=1,h=0;rs='\0';
		for(;!isdigit(rs)&&rs!=EOF;){if(rs=='-')f=-1;rs=ch();}
		for(;isdigit(rs)&&rs!=EOF;){h=(h<<3)+(h<<1)+(rs^48);rs=ch();}
		return f*h;
	}
	inline short read_short(){
		int f=1,h=0;rs='\0';
		for(;!isdigit(rs)&&rs!=EOF;){if(rs=='-')f=-1;rs=ch();}
		for(;isdigit(rs)&&rs!=EOF;){h=(h<<3)+(h<<1)+(rs^48);rs=ch();}
		return f*h;
	}
	inline string read_string(){
		rs=ch();//去空格
		string f; 
		while((rs=ch())!=' '&&rs!='\n'){
			rs=ch();
			f=f+rs;
		}
		return f;
	}
	inline void write_int128(__int128 x) {
		len=0,fh=0;if(x==0) {putch('0');return;}
		if(x<0&&x!=-339015474820318638148614395449002950656)fh=1,x=-x;if(x==-339015474820318638148614395449002950656)fh=2;
		if(fh!=2)for(; x;)tmp[++len]=(x%10+'0'),x/=10;
		else for(;x;)tmp[++len]=((-(x%10))+'0'),x/=10;
		if(fh)putch('-');
		for(int i=len; i>=1; i--)putch(tmp[i]);
	}
	inline void write_long_long(long long x) {
		len=0,fh=0;if(x==0) {putch('0');return;}
		if(x<0&&x!=-4611686018427387904) fh=1,x=-x;if(x==-4611686018427387904)fh=2;
		if(fh!=2)for(; x;)tmp[++len]=(x%10+'0'),x/=10;
		else for(;x;)tmp[++len]=((-(x%10))+'0'),x/=10;
		if(fh)putch('-');
		for(int i=len; i>=1; i--) putch(tmp[i]);
	}
	inline void write_int(int x) {
		len=0,fh=0;if(x==0) {putch('0');return;}
		if(x<0&&x!=-2147483648)fh=1,x=-x;if(x==-2147483648)fh=2;
		if(fh!=2)for(; x;)tmp[++len]=(x%10+'0'),x/=10;
		else for(;x;)tmp[++len]=((-(x%10))+'0'),x/=10;
		if(fh)putch('-');
		for(int i=len;i>=1;i--)putch(tmp[i]);
	}
	inline void write_int(short x) {
		len=0,fh=0;if(x==0) {putch('0');return;}
		if(x<0&&x!=-65536)fh=1,x=-x;if(x==-65536)fh=2;
		if(fh!=2)for(; x;)tmp[++len]=(x%10+'0'),x/=10;
		else for(;x;)tmp[++len]=((-(x%10))+'0'),x/=10;
		if(fh)putch('-');
		for(int i=len;i>=1;i--)putch(tmp[i]);
	}
	inline void write_char(char s){putch(s);}
	inline char read_char(){return ch();}
	inline void write_string(string s){for(int i=0;i<s.size();i++)putch(s[i]);}
	inline bool read_bool(){return (bool)(ch()-'0');}
	inline void write_bool(bool x){putch((x==true?'1':'0'));}
	struct Basic {
		Basic &operator >>(int &A){A=IO::read_int();return(*this);};
		Basic &operator <<(int &A){IO::write_int(A);return(*this);};
		Basic &operator >>(bool &A){A=IO::read_bool();return(*this);};
		Basic &operator <<(bool &A){IO::write_bool(A);return(*this);};
		Basic &operator >>(char &A){A=IO::read_char();return(*this);};
		Basic &operator <<(char &A){IO::write_char(A);return(*this);};
		Basic &operator >>(string &A){A=IO::read_string();return(*this);};
		Basic &operator <<(string &A){IO::write_string(A);return(*this);};
		Basic &operator >>(__int128 &A){A=IO::read_int128();return(*this);};
		Basic &operator <<(__int128 &A){IO::write_int128(A);return(*this);};
		Basic &operator >>(long long &A){A=IO::read_long_long();return(*this);};
		Basic &operator <<(long long &A){IO::write_long_long(A);return(*this);};
		void Flush() {flush();}
	} fin,fout;
}
原文