zoukankan      html  css  js  c++  java
  • 炒鸡好用的头文件

    #include <bits/stdc++.h>
    
    #define F first
    #define S second
    #define pb push_back
    #define NL cout << "
    ";
    #define rep(x,y) for(int i = x;i < y;i++)
    #define INF 2147483647
    #define M 1000000007
    #define MAX 105
    #define MOD %
    #define NE !=
    #define EE ==
    using namespace std;
    
    ////////////////////////////////////////////////////////////////////////////////////
    
    typedef long long int lld;
    typedef pair<int, int> pii;
    typedef pair<int, string> pis;
    typedef pair<string, string> pss;
    typedef vector<int> vi; 
    typedef vector<pii> vii;
    typedef vector<string> vs;
    typedef vector<pis> vis;
    typedef set<int> si;
    typedef set<pii> sii;
    typedef set<pis> sis;
    typedef map<int, int> mii;
    typedef map<int, string> mis;
    
    ////////////////////////|--Global Declarations--|///////////////////////////////////
    
                        int alpha[26] = {0}, dig[MAX] = {0};
    
    ////////////////////////////////////////////////////////////////////////////////////
    
    lld gcd(lld a, lld b)
    {
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }
    
    lld lcm(lld a, lld b)
    {
        return ((a * b) / gcd(a, b));
    }
    
    bool isPrime(int n)
    {
        if (n <= 1)  
            return false;
        if (n <= 3)  
            return true;
        if (n % 2 == 0 || n % 3 == 0) 
            return false;
        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
               return false;
        return true;
    }
    
    void getArr(int a[], int n)
    {
        rep(0, n)
            cin >> a[i];
    }
    void putArr(int a[], int n)
    {
        rep(0, n)
            cout << a[i] << " ";
        NL
    }
    
    void initAlpha(string s)
    {
        int n = s.size();
        rep(0, n)
            alpha[s[i] - 'a']++;
    }
    
    void initDigit(int a[], int n)
    {
        rep(0, n)
            dig[a[i]]++;
    }
    
    bool isPalindrome(string input)
    {
         if(input == string(input.rbegin(), input.rend()))
                  return true;
            return false;
    }
    
    
    int numLen(int n)
    {
     int len =0;
        while(n !=0)
       {
         n /=10;
         len++;
       }
         return len;
    }
     
  • 相关阅读:
    mongodb安装
    node版本的管理 n
    npm 命令
    nodejs,npm安装(ubuntu14.04下)
    yeoman,grunt,bower安装(ubuntu14.04)
    什么是堆和栈,它们在哪儿?
    malloc函数详解 (与new对比)
    单链表的C++实现(采用模板类)
    短信验证码
    webapi
  • 原文地址:https://www.cnblogs.com/Roni-i/p/7590914.html
Copyright © 2011-2022 走看看