這題直接套大數模板就行了,我硬是要寫一發double試試,結果果斷wa了n多發,最後還沒過。
也許是我修為太淺,不能找到double的正確ac姿勢。而且發現一般這種題基本上都是考大數的,用double基本上過不了,除了一些特殊的題目。
#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;
#define ll long long
#define int (1<<31)-1;//2147483647
const int maxn=1000;
struct bign
bign operator =(const char* num)
else
}return c;
}bign operator /(const int &b) const
temp=(temp-s[i])/10;
for(;i>=0;i--)
else
}for(int i=0;i=0;i--)
if(s[i]!=b.s[i]) return s[i](const bign &b) const
bool operator >=(const bign &b) const
};istream &operator >> (istream &in,bign &x)
ostream &operator << (ostream &out,const bign &x)
int flag=1;
for(int i=1;i
hdu 1134 大數模板
include include include includeusing namespace std define maxn 9999 define maxsize 10 define dlen 4 class bignum 建構函式 bignum const int 將乙個int型別的變數轉化為大...
HDU 大數模板之Children s Queue
include include include include includeusing namespace std define maxn 9999 define maxsize 10 define dlen 4 class bignum 建構函式 bignum const int 將乙個int型...
模板整理 大數模板
include include include include include includeusing namespace std define maxn 9999 define maxsize 1000 define dlen 4 class bignum 建構函式 bignum const i...