读优输优炸了,为什么
  • 板块灌水区
  • 楼主ClapEcho233
  • 当前回复4
  • 已保存回复4
  • 发布时间2020/11/3 14:00
  • 上次更新2023/11/5 09:08:10
查看原帖
读优输优炸了,为什么
321619
ClapEcho233楼主2020/11/3 14:00

rt,

#include<bits/stdc++.h>
using namespace std;
namespace IN {
    const int MAX_INPU = 1000000;
    #define getc() (p1 == p2 && (p2 = (p1 = buf) + inbuf -> sgetn(buf, MAX_INPU), p1 == p2) ? EOF : *p1++)
    char buf[MAX_INPU], *p1, *p2;
    template <typename T> inline bool read(T &x) {
        static std::streambuf *inbuf = cin.rdbuf();
        x = 0;
        register int f = 0, flag = false;
        register char ch = getc();
        while (!std::isdigit(ch)) {
            if (ch == '-') f = 1;
        	ch = getc();
        }
        if (std::isdigit(ch)) x = x * 10 + ch - '0', ch = getc(),flag = true;
        while (std::isdigit(ch)) {
            x = x * 10 + ch - 48;
            ch = getc();
        }
        x = f ? -x : x ;
        return flag;
    }
    template <typename T,typename ...Args> inline bool read(T& a,Args& ...args) {
       return read(a) && read(args...);
    }
    #undef getc
}

namespace OUT {
    template <typename T> inline void print(T x) {
        static std::streambuf *outbuf = cout.rdbuf();
        static char stack[21];
        static int top = 0;
        if (x < 0) {
            outbuf -> sputc('-');
            x=-x;
        }
        if (!x) {
            outbuf -> sputc('0');
            outbuf -> sputc('\n');
            return;
        }
        while (x) {
            stack[++top] = x % 10 + '0';
            x /= 10;
        }
        while (top) {
            outbuf -> sputc(stack[top]);
            -- top;
        }
        outbuf -> sputc('\n');
    }
    inline void printc(const char ch) {
        static std::streambuf *outbuf = cout.rdbuf();
        outbuf -> sputc(ch);
    }
    template <typename T> inline void print(const char ch,T x)
    {
        static std::streambuf *outbuf = cout.rdbuf();
        static char stack[21];
        static int top = 0;
        if (x < 0) {
            outbuf -> sputc('-');
            x=-x;
        }
        if (!x) {
            outbuf -> sputc('0');
            outbuf -> sputc(ch);
            return;
        }
        while (x) {
            stack[++top] = x % 10 + '0';
            x /= 10;
        }
        while (top) {
            outbuf -> sputc(stack[top]);
            --top;
        }
        outbuf -> sputc(ch);
    }
    template<typename T,typename ...Args> inline void print(T a,Args ...args) {
        print(a);print(args...);
    }
    template<typename T,typename ...Args> inline void print(const char ch,T a,Args ...args) {
        print(ch,a);print(ch,args...);
    }
}
using IN::read;
using OUT::print;
using OUT::printc;
int main(){
	
	int a,b;
	read(a,b);
	print(' ',a,b);
	
	return 0;
}
2020/11/3 14:00
加载中...