zoukankan      html  css  js  c++  java
  • HDU 2274 Magic WisKey

    打表。把每一种情况的和都计算出来,这个可以按位统计贡献。询问的时候输出即可。

    #pragma comment(linker, "/STACK:1024000000,1024000000")
    #include<cstdio>
    #include<cstring>
    #include<cmath>
    #include<algorithm>
    #include<vector>
    #include<map>
    #include<set>
    #include<queue>
    #include<stack>
    #include<iostream>
    using namespace std;
    typedef long long LL;
    const double pi=acos(-1.0),eps=1e-6;
    void File()
    {
        freopen("D:\in.txt","r",stdin);
        freopen("D:\out.txt","w",stdout);
    }
    template <class T>
    inline void read(T &x)
    {
        char c = getchar();
        x = 0;
        while(!isdigit(c)) c = getchar();
        while(isdigit(c)) { x = x * 10 + c - '0'; c = getchar(); }
    }
    
    int ans[100010];
    
    void init()
    {
        for(int i=0;i<=99999;i++) //00000-99999
        {
            ans[i]=0;
            int tmp=i;
            while(tmp)
            {
                int x=tmp%10; tmp=tmp/10;
                ans[i]=ans[i]+266664*x;
            }
            ans[i]=ans[i]-i;
        }
    }
    
    int main()
    {
        init();
        int n;
        while(~scanf("%d",&n))
        {
            for(int i=0;i<=99999;i++)
            {
                if(ans[i]!=n) continue;
                printf("%05d
    ",i);
            }
        }
        return 0;
    }
  • 相关阅读:
    js 图表处理之Echar
    web.py url传参及获取
    算法理论基础
    Django------model基础
    python 数据分析----matplotlib
    python 数据分析----pandas
    python 数据分析----numpy
    ipythons 使用攻略
    Django----Request对象&Response对象
    Django---ModelForm详解
  • 原文地址:https://www.cnblogs.com/zufezzt/p/6294201.html
Copyright © 2011-2022 走看看