__int128
__int128 __uint128 __int128_t __uint128_t
大小:16字节 2^128(sizeof())
2^128 39位 340282366920938463463374607431768211456
Codeblocks 无法使用,Dev C++ 可以使用,有时候比赛能用
Problem:A+B
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <time.h>
#include <string>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>
#include <ext/rope>
#include <algorithm>
#include <iostream>
using namespace std;
#define ll long long
#define minv 1e-6
#define inf 1e9
#define pi 3.1415926536
#define E 2.7182818284
const ll mod=1e9+;//
const int maxn=1e2+; inline void read(__int128 &x)
{
bool f=;
char ch;
if ((ch=getchar())==EOF)
exit();
while (ch<'' || ch>'')
f|=ch=='-',ch=getchar();
x=;
while (ch>='' && ch<='')
x=(x<<)+(x<<)+ch-'',ch=getchar();
if (f)
x=-x;
} void write(__int128 &x)
{
int a[],w=,i;
bool f=;
if (x<)
f=,x=-x;
while (x)
{
a[++w]=x%;
x/=;
}
///putchar:faster
if (f)
putchar('-');
for (i=w;i>=;i--)
putchar(a[i]+'');
if (w==)
putchar('');
putchar('\n');
} int main()
{
__int128 x,y;
while ()
{
read(x);
read(y);
x+=y;
write(x);
}
return ;
}
__int128的更多相关文章
- 关于__int128
定义 __int128 n,r,g,b,T; __int128 ans; __int128 f[][]; 取最大值函数 __int128 getmax(__int128 a,__int128 b){ ...
- 关于 __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使用
输入输出模板: __int128无法使用cin和cout进行输入输出,所以只能自己写一个输入输出的模板: #include <bits/stdc++.h> using namespace ...
- 详解__int128
前言 如果遇到 long long 开不下的情况,可以使用 __int128 来博一把! note :__int128 仅 \(64\) 位 \(GCC G++\) 支持,不在 \(C++\) 标准中 ...
- __int128的实现
#include<bitset> #include<algorithm> #include<iostream> #include<string> #in ...
随机推荐
- git基本操作1
1.创建版本库 在文件夹下,打开Git Bash Here ,然后执行git init,文件夹中会多出.git文件夹.(.git可能是隐藏的) 2.创建a.txt vim a.txt ,并添加到版本 ...
- C#后台绑定select
- P1091 合唱队形 最长上升子序列
思路:最长上升子序列 正着做一遍 倒着做一遍 然后 取最大值 #include<bits/stdc++.h> using namespace std; const int maxn=105 ...
- alter table,复制, 单表查询
修改表 语法:1. 修改表名 ALTER TABLE 表名 RENAME 新表名; 2. 增加字段 ALTER TABLE 表名 ...
- 洛谷P4782 2-SAT问题
2-SAT问题 这是一道2-SAT的模板题.对于2-SAT问题的每一个条件,我们需要把他们转化成可接受的条件.即"若变量A的赋值为x,则变量B的赋值为y",其中x,y均等于0或1. ...
- 用贝叶斯定理解决三门问题并用Python进行模拟(Bayes' Rule Monty Hall Problem Simulation Python)
三门问题(Monty Hall problem)也称为蒙提霍尔问题或蒙提霍尔悖论,出自美国的电视游戏节目<Let’s Make a Deal>.问题名字来自该节目的主持人蒙提·霍尔(Mon ...
- Chessboard POJ - 2446(最大流 || 匹配)
there is a pair of integers (x, y) in each line, which represents a hole in the y-th row, the x-th c ...
- CSAPC2008 skyline
一座山的山稜线由许多片段的45度斜坡构成,每一个片段不是上坡就是下坡. * * * /\* /\ /\/ \/\/ \/ \ 在我们眼前的所见的任何宽度为n个单位的 ...
- LOJ #2234. 「JLOI2014」聪明的燕姿(搜索 + 数论)
题意 给出一个数 \(S\) ,输出所有约数和等于 \(S\) 的数. \(S \le 2 \times 10^9\) ,数据组数 \(\le 100\) . 题解 首先用约数和定理: \[ \beg ...
- Codeforces Round #489 (Div. 2) E. Nastya and King-Shamans(线段树)
题意 给出一个长度为 \(n\) 的序列 \(\{a_i\}\) , 现在会进行 \(m\) 次操作 , 每次操作会修改某个 \(a_i\) 的值 , 在每次操作完后你需要判断是否存在一个位置 \(i ...