跳到正文

剪贴板

剪贴板 lx6gcoo0

原文
剪贴板信息

剪贴板信息

收录
更新
C++
#include<algorithm>
#include<cmath>
#include<cctype>
#include<cstdio>
#include<ctime>
#define FM int
#define FDDM long long
#define file(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout)
#define local(x) freopen(#x".in","r",stdin),freopen(#x"_.out","w",stdout)
#define check_memory fprintf(stderr,"\nmemory=%.4lfMB",abs(&M1-&M2)/1024.0/1024.0)
#define check_time fprintf(stderr,"\ntime=%dms",clock())
using namespace std;
bool M1;
namespace SuperIO{
	#ifdef LOCAL
		FILE*Fin(stdin),*Fout(stdout);
	#else
		FILE*Fin(fopen("data.in","r")),*Fout(fopen("data.out","w"));
	#endif
	namespace IO{
		class qistream{
    		static const size_t SIZE=1<<16,BLOCK=32;
    		FILE*fp;
    		char buf[SIZE];
    		FM p;
			public:
    			qistream(FILE*_fp=stdin):fp(_fp),p(0){
        			fread(buf+p,1,SIZE-p,fp);
    			}
    			inline void flush() {
        			__builtin_memmove(buf,buf+p,SIZE-p),fread(buf+SIZE-p,1,p,fp),p=0;
    			}
    		template<class T>qistream&operator>>(T&x){
        		x=0;
       			p+BLOCK>=SIZE?flush():void();
        		bool flag=false;
        		for(;!isdigit(buf[p]);++p)
            		flag=buf[p]=='-';
       		 	for(;isdigit(buf[p]);++p)
            		x=x*10+(buf[p]^48);
        		x=flag?-x:x;
        		return*this;
    		}
    		#define getch() buf[p++]
    		qistream&operator>>(char*str){
        		char ch=getch();
        		while(ch<=' ')
            		ch=getch();
				for(FM i=0;ch>' ';++i,ch=getch())
            		str[i]=ch;
				return*this;
   			}
		}qcin(Fin);
		class qostream{
    		static const size_t SIZE=1<<16,BLOCK=32;
    		FILE*fp;
    		char buf[SIZE];
    		FM p;
			public:
    			qostream(FILE *_fp=stdout):fp(_fp),p(0){}~qostream(){
        			fwrite(buf,1,p,fp);
    			}
    			inline void flush(){
        			fwrite(buf,1,p,fp),p=0;
    			}
    		template<class T>qostream&operator<<(T x){
        		FM len=0;
        		p+BLOCK>=SIZE?flush():void();
        		x<0?(x=-x,buf[p++]='-'):0;
				do
            		buf[p+len]=x%10+'0',x/=10,++len;
				while(x);
				for(FM i=0,j=len-1;i<j;++i,--j)
            		swap(buf[p+i],buf[p+j]);
        		p+=len;
        		return*this;
    		}
    		inline void putch(char ch){
        		buf[p++]=ch;
    		}
    		qostream&operator<<(const char*str){
        		for(FM i=0;str[i];++i)
            		putch(str[i]);
        		return*this;
    		}
		}qcout(Fout);
	}
	using namespace IO;
}
using namespace SuperIO;
bool M2;
FM main(){

	check_time,check_memory;
	return 0;
}