跳到正文

个人记录

file_read/write

zlqwq约 3 分钟
原文
文章信息与版本

文章信息

收录
2026年6月7日
更新
2026年6月7日
篇幅
约 3 分钟
获赞
1

版本

  1. v1当前
C++
#include<bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define pii pair<int,int>
#define il inline
#define rep(x,y,z) for(register int x=(y);x<=(z);++x)
#define per(x,y,z) for(register int x=(y);x>=(z);--x)
#define repvec(y,x) for(const auto &y:x)
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define push emplace
#define pb push_back
#define pq priority_queue
#define vi vector<int>
#define all(vec) vec.begin(),vec.end()
#define gi greater<int>
#define vpii vector<pii>
#define gpii greater<pii>
#define inf (ll)(1e18/5)
#define umap unordered_map
#define mkp make_pair
#define mset multiset
#define lll __int128
using namespace std;
#ifdef ONLINE_JUDGE
char buf[1<<20],*p1=buf,*p2=buf;
il char gc(){
	if(p1==p2){
		p2=(p1=buf)+fread(buf,1,1<<20,stdin);
		if(p1==p2)return EOF;
	}
	return *p1++;
}
char pbuf[1<<20],*pp=pbuf;
il void pc(char c){
	if(pp-pbuf==(1<<20))fwrite(pbuf,1,1<<20,stdout),pp=pbuf;
	*pp++=c;
}
il void flush(){
	if(pp-pbuf)fwrite(pbuf,1,pp-pbuf,stdout);
	pp=pbuf;
}
#else
#define gc getchar
#define pc putchar
#define flush() cout<<'\n'
#endif
il int read(){
	int x=0,f=1;char ch=gc();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=gc();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=gc();}
	return x*f;
}
il void print(int x){
	if(x<0)pc('-'),x=-x;
	if(x>9)print(x/10);
	pc(x%10+'0');
}
signed main(){
	flush();
	return 0;
}
/*

*/

原文