Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline char fgc() {
- static char buf[100000], *p1 = buf, *p2 = buf;
- return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2) ? EOF : *p1++;
- }
- inline LL readint() {
- register LL res = 0, neg = 1;
- char c = fgc();
- while (c < '0' || c > '9') {
- if(c == '-') neg = -1;
- c = fgc();
- }
- while (c >= '0' && c <= '9') {
- res = res * 10 + c - '0';
- c = fgc();
- }
- return res * neg;
- }
- inline double readdemi() {
- register double res = 0;
- register int siz = 0, neg = 1;
- register bool indem = false;
- char c = fgc();
- while (c < '0' || c > '9') {
- if(c == '-') neg = -1;
- c = fgc();
- }
- while ((c >= '0' && c <= '9') || c == '.') {
- if(c == '.') {
- indem = true;
- c = fgc();
- continue;
- }
- if(indem) siz++;
- res = res * 10 + c - '0';
- c = fgc();
- }
- while(siz--) res /= 10;
- return res * neg;
- }
Advertisement
Add Comment
Please, Sign In to add comment