__int128使用
输入输出模板:
__int128无法使用cin和cout进行输入输出,所以只能自己写一个输入输出的模板:
#include <bits/stdc++.h> using namespace std; void scan(__int128 &x)//输入
{
x = ;
int f = ;
char ch;
if((ch = getchar()) == '-') f = -f;
else x = x* + ch-'';
while((ch = getchar()) >= '' && ch <= '')
x = x* + ch-'';
x *= f;
}
void _print(__int128 x)
{
if(x > ) _print(x/);
putchar(x% + '');
}
void print(__int128 x)//输出
{
if(x < )
{
x = -x;
putchar('-');
}
_print(x);
}
int main()
{
__int128 a, b;
scan(a); scan(b);
print(a + b);
return ;
}
[注]:只能在Linux环境下使用__int128,具体参考参考1
参考:
__int128使用的更多相关文章
- 关于__int128
定义 __int128 n,r,g,b,T; __int128 ans; __int128 f[][]; 取最大值函数 __int128 getmax(__int128 a,__int128 b){ ...
- __int128
__int128 __uint128 __int128_t __uint128_t 大小:16字节 2^128(sizeof()) 2^128 39位 340282366920938463463374 ...
- 关于 __int128
__int128 是 GCC 提供的扩展(extension),可以当作 128 位整数使用. 关于 __int128 和 __int128_t Normally, _t suffix means a ...
- hdu6222——佩尔方程&&大数__int128
题意 给定一个整数 $N$($1 \leq N \leq 10^{30}$),求最小的整数 $t$,要求 $t \geq N$,使得边长为 $t-1, t, t+1$ 的三角形面积为整数. 分析 根据 ...
- __int128 输入输出模板
#include <bits/stdc++.h> using namespace std; void scan(__int128 &x)//输入 { x = ; ; char ch ...
- iostream重载__int128
Normal (Naive)写法,用 string(char* ) std::ostream& operator <<(std::ostream&out,const __i ...
- HDU6719 Strassen(__int128)
HDU6719 Strassen 直接照题目模拟,数据范围最大不会超过__int128. 时间复杂度为 \(O(\log n)\) . #include<bits/stdc++.h> us ...
- 详解__int128
前言 如果遇到 long long 开不下的情况,可以使用 __int128 来博一把! note :__int128 仅 \(64\) 位 \(GCC G++\) 支持,不在 \(C++\) 标准中 ...
- __int128的实现
#include<bitset> #include<algorithm> #include<iostream> #include<string> #in ...
随机推荐
- 【MM系列】SAP ABAP 在选择画面显示输出结果
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP 在选择画面显示 ...
- poj3253Fence Repair (Huffman)
Huffman树:具有n个外部节点(叶子节点)的二叉树 每个外部节点都有一个对应的权值Wi 叶节点带权外部路径长度总和WPL=Wi*Li(i从1到n)最小(权越大的节点里根越进) 构造Huffman树 ...
- response.getWriter()和jsp中的out对象的区别
(1) out和response.getWriter属于的类不同,前者是JspWriter,后者是java.io.PrintWriter.而JspWriter是一个抽象类, PrintWriter是一 ...
- Android超简单气泡效果
阿里P7移动互联网架构师进阶视频(每日更新中)免费学习请点击:https://space.bilibili.com/474380680最近有用到水下气泡上升效果,因此在网上查了一下资料,结果还真找到了 ...
- [LeetCode] Linked List Cycle II, Solution
Question : Given a linked list, return the node where the cycle begins. If there is no cycle, return ...
- hdu5943 Kingdom of Obsession 二分图+打表找规律
题目传送门 Kingdom of Obsession Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
- P4542 [ZJOI2011]营救皮卡丘(Floyd+网络流)
P4542 [ZJOI2011]营救皮卡丘 乍一看似乎没啥题相似的 仔细一看,$N<=150$ 边又是双向边,似乎可以用Floyd搞 先跑一遍Floyd处理出$dis[i][j]$ 注意到走 ...
- Java-技术专区-设计模式-reactor模式
模型: 反应器模式做法是:汽车是乘客访问的主体(Reactor),乘客上车后,到售票员(acceptor)处登记,之后乘客便可以休息睡觉去了,当到达乘客所要到达的目的地后,售票员将其唤 ...
- 【转】sed命令的基本操作
原文链接 sed命令行格式为: sed [-option] ‘command’ 输入文本/文件 常用选项: -n∶取消默认的输出,使用安静(sile ...
- Spring bean相关
Spring中指定Bean的作用于的方式 以下四种为例: 单例(默认,可以不用特殊表明) @Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON) ...