__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 ...
随机推荐
- Object.watch
/* * object.watch polyfill * * 2012-04-03 * * By Eli Grey, http://eligrey.com * Public Domain. ...
- flask为blueprint增加error_handler
对整个app增加errorhandler,只需如下: @portal_page.errorhandler(404) def page_not_found(error): cats = Category ...
- Linux部署禅道环境
1.打开WinSCP 2. 输入Linux IP 用户名(root)及密码(123456)并点击保存 3. 点击登录后再输入一次密码 4.把ZenTaoPMS.11.2.stable.zbox_6 ...
- LeetCode #938. Range Sum of BST 二叉搜索树的范围和
https://leetcode-cn.com/problems/range-sum-of-bst/ 二叉树中序遍历 二叉搜索树性质:一个节点大于所有其左子树的节点,小于其所有右子树的节点 /** * ...
- CodeChef Mahesh and his lost array
Mahesh and his lost array Problem code: ANUMLA Submit All Submissions All submissions for this ...
- Codeforces Round #574 (Div. 2) A~E Solution
A. Drinks Choosing 有 $n$ 个人,每个人各有一种最喜欢的饮料,但是买饮料的时候只能同一种的两个两个买(两个一对) 学校只打算卖 $\left \lceil \frac{n}{2} ...
- angularjs 信息链接 转摘自:http://www.zhihu.com/question/27427447
这个问题嘛,真不好回答,问的太笼统了,其实你只要熟悉掌握了Angular.js,自然而然的就会用Angular.js结合自身的业务去构建SPA程序了,Angular.js是一个比较全面的框架,按照他的 ...
- 【转】 关于form与表单提交操作的一切
参考一:http://caibaojian.com/form.html 参考二:https://blog.csdn.net/weixin_42301628/article/details/867156 ...
- linux系统部署war包,查看tomcat日志
1.部署war包app/tomcat/bin在tomcat/bin 目录下启动 .startup.sh,在启动过程中tomcat会对war包进行解压,形成相应的项目目录 执行命令:./startup. ...
- 解决嵌套在ScrollView中的TableView滑动手势冲突问题
最近在迭代开发公司项目的时候遇到了一个问题,在可以左右切换标签视图的ScrollView中嵌套了两个TableView用于展示视图,感觉一切so easy的情况下,问题出现了,因为左右两个视图既可以实 ...