C++超级快读快写2.3

#ifndef VERY_FAST_IO3
#define VERY_FAST_IO3
#include <unistd.h>
#include<bits/stdc++.h>
 
namespace MTL{
   
   
	using namespace std;
	//getchar_unlocked/putchar_unlocked貌似快一点? 
	#define likely(x) __builtin_expect(!!(x), 1)
	#define unlikely(x) __builtin_expect(!!(x), 0)
	class fast_ios{
   
   //out普通操作0~9,in普通操作10~19,格式操作30~39,流修改50~59 
		long long Key_,seting;
		public:
			fast_ios(long long k,long long setin=0){
   
   
				Key_=k;seting=setin;
			}
			friend fast_ios operator|(fast_ios a,fast_ios b);
			long long operator&(long long b){
   
   
				return Key_&b;
			}
			long long get_seting(){
   
   return seting;}
	}; 
	fast_ios operator|(fast_ios a,fast_ios b){
   
   
		return fast_ios(a.Key_|b.Key_);
	}
	namespace fast_ios_base{
   
   
		const fast_ios fast_ends(1ll),fast_flush(1ll<<1),fast_endl(3ll),fast_lock(1ll<<50),fast_unlock(1ll<<51),fast_ws(1<<10),fast_out(1<<9),fast_in(1<<19),fast_append((1<<8)|(1<<9));
	} 
	const fast_ios fast_setf(long long k){
   
   //设置double精度 
		return fast_ios(1ll<<30,k);
	}
	namespace const_val{
   
   
		const long long buf_len=998732;
		//const long long buf_len=1<<16;
		//const long long fast_ios_len=2;//fast_ios的有效位数 
	}
	class fast_io{
   
   
		#define buf_len const_val::buf_len
		bool is_lock=1;
		char buf_i[buf_len],buf_o[buf_len];
		long long in_i=0,out_i=0,double_out_len=9;
		bool IO_OK=1;
		double double_out_min=1E-10,double_out_mlen=100000000;
		FILE *fastin=NULL,*fastout=NULL;
		public:
			fast_io(){
   
   
				fastin=stdin,fastout=stdout;
				in_i=buf_len;
				
			}
			fast_io(string file_name,fast_ios f=fast_ios((1<<9)|(1<<19))){
   
   
				if(f&(1<<9)){
   
   
					if(f&(1<<8))fastout=fopen((file_name+string(".out")).c_str(),"ab");
					else fastout=fopen((file_name+string(".out")).c_str(),"wb");
				}
				if(f&
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值