快读

inline int read()
{
int X=; bool flag=; char ch=getchar();
while(ch<''||ch>'') {if(ch=='-') flag=; ch=getchar();}
while(ch>=''&&ch<='') {X=(X<<)+(X<<)+ch-''; ch=getchar();}
if(flag) return X;
return ~(X-);
}

快输

inline void write(int X)
{
if(X<) {X=~(X-); putchar('-');}
if(X>) write(X/);
putchar(X%+'');
}

c++ 快读快输模板的更多相关文章

  1. 快读&快写模板【附O2优化】

    快读&快写模板 快读快写,顾名思义,就是提升输入和输出的速度.在这里简单介绍一下几种输入输出的优劣. C++ cin/cout 输入输出:优点是读入的时候不用管数据类型,也就是说不用背scan ...

  2. P1908 逆序对——树状数组&离散化&快读快写の学习

    题目简述: 对于给定的一段正整数序列,逆序对就是序列中 a_i>a_jai​>aj​ 且 i<ji<j 的有序对. 输出序列中逆序对的数目. 知识补充: 树状数组: 这东西就是 ...

  3. 卡常三连(快读快写+re)

    快读: inline int in() { char ch; ; '))); a*=;a+=ch-'; ,a+=ch-'; return a; } 快写: inline void out(int a) ...

  4. C++笔记——快读快写

    直接开始吧 额m~,这里就没什么好说的了,无非就是用getchar加快cin或printf的读入速度. 代码: inline int read() { int X=0; bool flag = 1; ...

  5. C++ 快读快写

    inline int read() { int s=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){ if(ch=='-') f=-1; c ...

  6. C++ 加速(卡常)技巧【超级 快读、快写】

    C++ \texttt{C++} C++ 加速技巧 快读快写 快读 inline int read() { int x = 0, w = 0; char ch = 0; while (!isdigit ...

  7. c++快读与快输模板

    快读 inline int read() { ; ; char ch=getchar(); ; ch=getchar();} )+(X<<)+ch-'; ch=getchar();} if ...

  8. C++快读模板

    C++的快速读入模板 inline int read() { ; char ch = getchar(); ') { if (ch == '-') flag = true; ch = getchar( ...

  9. 快读模板 + #define 压缩for

    快读是一个很重要的模板 #define 压缩for是为了代码的简洁 这里贴一下模板 #define f(i , a , b) for(int i=(a) ; i <= (b) ; i++) us ...

随机推荐

  1. vue-上传文件

    <label for="exampleInputFile">头像</label> <img :src=" imgsrc != '' ? im ...

  2. CCPC2018 桂林 D "Bits Reverse"

    传送门 题目描述 Now given two integers x and y, you can reverse every consecutive three bits ,,) means chan ...

  3. Java中try catch finally执行

    直接上代码实例: public static void main(String[] args) {    System.out.println(test1()); } static int test1 ...

  4. Linux 内核控制 urb

    控制 urb 被初始化几乎和 块 urb 相同的方式, 使用对函数 usb_fill_control_urb 的 调用: void usb_fill_control_urb(struct urb *u ...

  5. centos 下yum lock的解决办法

    centos 下yum lock的解决办法 centos7下yum install的时候,报了一堆错误,如下: Another app is currently holding the yum loc ...

  6. 微服务Dubbo和SpringCloud架构设计、优劣势比较

    本文主要围绕微服务的技术选型.通讯协议.服务依赖模式.开始模式.运行模式等几方面来综合比较Dubbo和Spring Cloud 这2种开发框架.架构师可以根据公司的技术实力并结合项目的特点来选择某个合 ...

  7. 天猫SSM项目学习记录(一)----第一个相对完整的SSM项目

    来源:  http://how2j.cn/k/tmall_ssm/tmall_ssm-1516/1516.html?p=78908 目的:记录一个相对完整的SSM项目模板 1.工具:idea2018商 ...

  8. Python学习(二)语言基础

    一.变量与类型 在程序设计中,变量是一种存储数据的载体 整型:Python中可以处理任意大小的整数 浮点型:浮点数也就是小数 字符串型:字符串是以单引号或双引号括起来的任意文本 布尔型:布尔值只有Tr ...

  9. 使用vue 对二进制文件 实现下载(blob对象

    有很多网站会涉及到文件下载,这里我们使用axios 发送请求 接受数据 第一步 模仿jQ 封装接口 Vue.prototype.$xlsx_post = function (url, data, fu ...

  10. 20191024-3 互评Alpha阶段作品

    此作业要求参见https://edu.cnblogs.com/campus/nenu/2019fall/homework/9860 本组对构建之法组评价的博客链接:https://www.cnblog ...