極 快速讀入

2022-10-08 20:42:14 字數 2566 閱讀 5898

14.8 kb 的快讀……

以後拉板子方便啦!

從 這裡 賀過來的 .

起源是 here .

用 mivik 的**壓行機 壓縮 .

變數名再壓就看不下去了,,,

放**:

#include#include#include#include#include#include#include// need to include
平凡版本(from here):

#include#ifndef online_judge

file*in=fopen("std.in","r");file*out=fopen("std.out","w");

#endif

#define string_safe_end

class io~io()

#else

io()~io()

#endif

io&flush()bool check()int read_neg()elsereturn u;}templateio&read(t&u)templateio&read_neg(t&u)elsereturn*this;}io&read_bool(bool&x)return*this;}char getchar()io&getl(char*a)int getl_len(char*a)io&gets(char*a)int gets_len(char*a)io&clear()char peek()io&putchar(const char x)io&print(const char*x)io&print(const unsigned char*x)io&puts(const char*x,const char end='\n')templateio&write(t x)templateio&write_neg(t x)io&write_tot(const char x)io&write_tot(const short x)io&write_tot(int x)io&write_tot(long x)io&write_tot(long long x)io&write_tot(const bool x)io&write_tot(const unsigned char x)io&write_tot(const unsigned short x)io&write_tot(const unsigned int x)io&write_tot(const unsigned long x)io&write_tot(const unsigned long long x)io&operator>>(bool&x)io&operator>>(char&x)io&operator>>(unsigned char&x)io&operator>>(short&x)io&operator>>(unsigned short&x)io&operator>>(int&x)io&operator>>(unsigned&x)io&operator>>(long&x)io&operator>>(unsigned long&x)io&operator>>(long long&x)io&operator>>(unsigned long long&x)io&operator>>(char*x)io&operator>>(unsigned char*x)io&operator<<(const bool x)io&operator<<(const char x)io&operator<<(const unsigned char x)io&operator<<(const short x)io&operator<<(const unsigned short x)io&operator<<(const int x)io&operator<<(const unsigned x)io&operator<<(const long x)io&operator<<(const unsigned long x)io&operator<<(const long long x)io&operator<<(const unsigned long long x)io&operator<<(const char*x)io&operator<<(const unsigned char*x)}io;

#define endl char(10)

cyjian 的(未壓)

namespace io 

inline void gc (char &x)

inline void pc (char x)

inline void pstr (const char *s)

inline void gstr (char *s)

template inline bool gi (i &x)

for (x = 0; __c <= '9' && __c >= '0' && !_eof; __c = gc()) x = x * 10 + (__c & 15), _eof |= __c == eof; x *= __f; return !_eof; }

template inline void print (i x)

struct flusher_ }io_flusher_;

} using io::pc; using io::gc; using io::pstr; using io::gstr; using io::gi; using io::print;

終極快速讀入掛極其使用方法

當遇到輸入很多的時候可以使用 據說1e5以上 能減少相當多的時間 define fi n fastio read n namespace fastio int sn 0 while bn s sn 0 return sn bool read int x 在本地執行是看不到輸出結果的,需要在檔案中檢視...

快速讀入詳解

當你在資訊學競賽 oi 中進入了提高組時,你可能會被卡常!程式被卡常數,一般指程式雖然漸進複雜度可以接受,但是由於實現 演算法本身的時間常數因子較大,使得無法在oi icpc等演算法競賽規定的時限內執行結束。常數被稱為計算機演算法競賽之中最神奇的一類數字,主要特點集中於令人捉摸不透,有時候會讓水平很...

快速讀入的技巧

在oj上練習題目時,有些題目資料的輸入非常大,即便是使用scanf 也會被卡常數,最後導致tle。因此蒐集網上的解決方案,常見的有以下兩種 一 當資料量不是特別大的時間,此時可以關閉stdio的同步,使得cin,cout與printf,scanf一樣快。核心 ios sync with stdio ...