Advertisement
Guest User

Untitled

a guest
Apr 12th, 2013
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.28 KB | None | 0 0
  1. #include <vector>
  2. #include <cstdlib>
  3. #include <cctype>
  4. #include <cstring>
  5. #include <sstream>
  6. #include <iostream>
  7. #include <cstdio>
  8. #include <cmath>
  9. #include <climits>
  10.  
  11. using namespace std;
  12.  
  13.  
  14. typedef long long ll;
  15. typedef long double ld;
  16. typedef unsigned long long ull;
  17. typedef unsigned int uint;
  18.  
  19. #ifdef _MSC_VER
  20.     const ld M_PI=(ld)3.1415926535897932384626433832795;
  21. #endif
  22.  
  23.  
  24. namespace Numbers
  25. {
  26.     class Lint
  27.     {
  28.     private:
  29.         static const int base=1e6;
  30.         static const int LOG_BASE=6;
  31.         static const int BIG_NUM_SZ=1e6;
  32.         static const Lint ONE;
  33.  
  34.         vector <int> v;
  35.         bool sgn;
  36.     public:
  37.         Lint();
  38.         Lint(int a);
  39.         Lint(unsigned int a);
  40.         Lint(ll a);
  41.         Lint(ull a);
  42.         Lint(const char* s);
  43.         Lint(const string& s);
  44.  
  45.         /*operator bool();*/
  46.         Lint operator -();
  47.         Lint& operator +=(Lint b);
  48.         Lint& operator -=(Lint b);
  49.         Lint& operator *=(const Lint& b);
  50.         Lint& operator /=(const Lint& b);
  51.         Lint& operator %=(const Lint& b);
  52.         Lint& operator +=(ll b);
  53.         Lint& operator -=(ll b);
  54.         Lint& operator *=(ll b);
  55.         Lint& operator /=(ll b);
  56.         Lint& operator %=(ll b);
  57.         Lint& operator ++();
  58.         Lint operator ++(int);
  59.         Lint& operator --();
  60.         Lint operator --(int);
  61.  
  62.         friend Lint operator +(const Lint&,const Lint&);
  63.         friend Lint operator -(const Lint&,const Lint&);
  64.         friend Lint operator *(const Lint&,const Lint&);
  65.         friend Lint operator /(const Lint&,const Lint&);
  66.         friend Lint operator %(const Lint&,const Lint&);
  67.         friend Lint operator /(const Lint&,ll);
  68.         friend Lint operator %(const Lint&,ll);
  69.         friend bool operator <(const Lint&,const Lint&);
  70.         friend bool operator ==(const Lint&,const Lint&);
  71.         friend bool operator >(const Lint&,const Lint&);
  72.         friend bool operator !=(const Lint&,const Lint&);
  73.         friend bool operator <=(const Lint&,const Lint&);
  74.         friend bool operator >=(const Lint&,const Lint&);
  75.         friend istream& operator >>(istream&,Lint&);
  76.         friend ostream& operator <<(ostream&,const Lint&);
  77.  
  78.         string std_str() const;
  79.         const char* c_str() const;
  80.  
  81.     private:
  82.         class Complex {/*definition here...*/};
  83.         friend void fft(vector <Complex>&,bool);
  84.  
  85.         void fast_mul(const Lint& b) {/*can't use fft from here*/};
  86.     };
  87.  
  88.     const Lint Lint::ONE=1;
  89.  
  90.     void fft(vector <Lint::Complex>& a,bool inv) {/*fft cod here...*/}
  91. };
  92.  
  93. typedef Numbers::Lint Lint;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement