方便人类——信息学训练专用库
来源:互联网 发布:阿里云电话客服 编辑:程序博客网 时间:2024/05/17 03:57
/* Author:597 Description: This is a Header File for coding. It has many function which can make us coding easily or running quickly.*/#include <cstdio>#include <cstring>#include <cmath>#include <cstdlib>#include <algorithm>using namespace std;//File IO#define I_O(x) freopen(""#x".in","r",stdin);freopen(""#x".out","w",stdout)//for Pascal党&码速 #define forp(i,a,b) for(i=a;i<=b;i++)#define form(i,a,b) for(i=a;i>=b;i--)#define until(x) while (!(x))//for "memset"#define INF 2139062143#define NINF -2139062144//for 读入优化 #define IN(x,a,b) (a<=x && x<=b)template <typename T> inline void input(T& x)//专为读整数设计 { char ch=getchar(); while (!(IN(ch,'0','9')||ch=='-')) ch=getchar(); if (ch!='-') { x=0; do { x=x*10+ch-48; ch=getchar(); } while (IN(ch,'0','9')); } else { ch=getchar(); x=0; do { x=x*10+ch-48; ch=getchar(); } while (IN(ch,'0','9')); x=-x; } }inline int get_int()//专为读int设计{ char ch=getchar(); int x=0; while (!(IN(ch,'0','9')||ch=='-')) ch=getchar(); if (ch!='-') { do { x=x*10+ch-48; ch=getchar(); } while (IN(ch,'0','9')); } else { ch=getchar(); do { x=x*10+ch-48; ch=getchar(); } while (IN(ch,'0','9')); x=-x; } return x;}//for mathtemplate <typename T> inline T sqr(T x){return x*x;}template <typename T> inline T pow(T x,T y) { T tmp=x,ret=1; while (y) { if (y&1) ret*=tmp; y>>=1; tmp*=tmp; } return ret; }//for random(including <cstdlib> and <ctime>)#define randomize srand(time(0))#define random(l,r) (l+rand()%(r-l+1))//for string#include <string>using namespace std;inline void input(string& s)//读字符串 { char ch=getchar(); while (!IN(ch,33,126)) ch=getchar(); s=""; do { s+=ch; ch=getchar(); } while (IN(ch,33,126));}inline void input_line(string& s){ char ch=getchar(); while (!IN(ch,32,126)) ch=getchar(); s=""; do { s+=ch; ch=getchar(); } while (IN(ch,32,126));}inline void output(string& s)//写字符串(没帮你换行,若是要换行打上putchar('\n');) { int i; for (i=0;s[i]!='\0';i++) putchar(s[i]);}
阅读全文
1 0
- 方便人类——信息学训练专用库
- 七中高新信息学竞赛训练——2017寒假第二次练习赛题解
- 信息学(OI)竞赛—常用算法网站
- 信息学 (计算机) 奥林匹克训练题 (中级部分)
- 信息学 (计算机) 奥林匹克训练题(中级部分)
- 2016.8.4信息学训练营练习
- 对9月份信息学训练的总结
- 人类简史——开篇
- 信息学
- 算法艺术与信息学竞赛——习题解答
- 生物信息学——RNA的剪切过程
- 二分图——《算法艺术与信息学竞赛》
- 信息学奥赛辅导 残缺棋盘——分治算法
- 生物信息学基础——基因表达过程
- 记NOIP2016全国信息学分区普级组——比赛感想
- 2012福建省信息学奥林匹克CCF NOIP夏令营第三天训练
- 对整个7月份信息学训练的总结
- 对整个8月份信息学训练的总结
- 34_面向对象_07_构造器(构造方法)
- 蓝桥杯 ALGO-148 算法训练 5-1最小公倍数
- WeX5向data组件动态添加数据格式
- Linux进程通信-管道(pipe)
- Eclipse下更新android sdk慢的解决办法
- 方便人类——信息学训练专用库
- 缓冲区溢出——远程代码执行问题
- JVM结构
- 蓝桥杯 ALGO-122 算法训练 未名湖边的烦恼
- 网络安全工程师就是网管吗?
- 基本VLAN特性配置与管理——4
- 如何删除\200, \343特殊字符
- [php_03]php类与对象
- Asp.net MVC中关于@Html标签Label、Editor使用