#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&
C++超级快读快写2.3
最新推荐文章于 2025-06-10 22:12:04 发布

最低0.47元/天 解锁文章
2721

被折叠的 条评论
为什么被折叠?



