最强外挂输入输出模板
2018-03-08 15:58
337 查看
/* 2017年多校第一场最后一题需要外挂输入输出进化版来处理数据,否则将会不停的TLE,从没想到是在外挂输入输出模板上面卡住了 从那场后长姿势了,马上更换成了这个模板,该代码是从标程中提取出来的,比一般的都强大,从此以后再没有在这上面被卡过。 需要freopen文件输入输出来测试样例答案,否则用命令行输入不会返回结果,交题时记得注释掉freopen喔~ */ #include <cstdio> #include <cstring> #include <algorithm> typedef long long LL; namespace fastIO { #define BUF_SIZE 100000 //fread -> read bool IOerror = 0; inline char nc() { static char buf[BUF_SIZE], *p1 = buf + BUF_SIZE, *pend = buf + BUF_SIZE; if(p1 == pend) { p1 = buf; pend = buf + fread(buf, 1, BUF_SIZE, stdin); if(pend == p1) { IOerror = 1; return -1; } } return *p1++; } inline bool blank(char ch) { return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'; } inline void read(int &x) { char ch; while(blank(ch = nc())); if(IOerror) return; for(x = ch - '0'; (ch = nc()) >= '0' && ch <= '9'; x = x * 10 + ch - '0'); } #undef BUF_SIZE }; using namespace fastIO; const int maxn = 1000001, mod = 1000000007; int n, num[maxn]; int main() { for(int Case = 1; read(n), !fastIO::IOerror; ++Case) { for(int i = 1; i <= n; ++i) read(num[i]); } return 0; }
相关文章推荐
- 【IO外挂】大量输入输出外挂模板
- POJ 1904 King's Quest 强连通分量 +缩点+ 输入输出外挂 (非递归版trajan模板)
- 输入输出外挂模板
- 输入输出外挂【模板】
- 输入输出外挂模板
- 数字和最大(读入外挂模板+DP或滚动数组)
- 程序输入输出外挂
- 输入输出外挂
- 输入输出外挂
- 输入输出外挂
- tornado开发学习之2.输入输出,数据库操作,内置模板,综合示例
- ACM 正负大数的读入外挂模板+单调队列模板
- HDU 6178 Monkeys【dfs】【输入外挂模板】
- tornado开发输入输出,数据库操作,内置模板,综合示例
- tornado开发学习之2.输入输出,数据库操作,内置模板,综合示例
- 2005年最强简历模板、简历封面资源下载贴
- tornado开发学习之2.输入输出,数据库操作,内置模板,综合示例
- ACM——输入输出外挂
- King's Quest - poj 1904(强连通分量+外挂输入输出)
- C++ 输入输出外挂 整数