首页 > ACM题库 > HDU-杭电 > HDU 2867-Continuous Digit-待解决[解题报告]HOJ
2014
02-17

HDU 2867-Continuous Digit-待解决[解题报告]HOJ

Continuous Digit

问题描述 :

We define f(m,k,n) is the value of the nth number which has m continuous digit k. For example, f(3,6,1)=666,f(3,6,2)=1666,f(3,6,3)=2666,….
Now give you m,k,n and ask you to solve f(m,k,n).

输入:

Input contains multiple cases each presented on a separate line. Each line contains three integer numbers m,k,n(2<=m<=10,1<=k<=9,1<=n<=1000000000).

输出:

Input contains multiple cases each presented on a separate line. Each line contains three integer numbers m,k,n(2<=m<=10,1<=k<=9,1<=n<=1000000000).

样例输入:

3 6 187

样例输出:

66666

 


  1. /*
    * =====================================================================================
    *
    * Filename: 1366.cc
    *
    * Description:
    *
    * Version: 1.0
    * Created: 2014年01月06日 14时52分14秒
    * Revision: none
    * Compiler: gcc
    *
    * Author: Wenxian Ni (Hello World~), [email protected]
    * Organization: AMS/ICT
    *
    * =====================================================================================
    */

    #include
    #include

    using namespace std;

    int main()
    {
    stack st;
    int n,i,j;
    int test;
    int a[100001];
    int b[100001];
    while(cin>>n)
    {
    for(i=1;i>a[i];
    for(i=1;i>b[i];
    //st.clear();
    while(!st.empty())
    st.pop();
    i = 1;
    j = 1;

    while(in)
    break;
    }
    while(!st.empty()&&st.top()==b[j])
    {
    st.pop();
    j++;
    }
    }
    if(st.empty())
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
    }
    return 0;
    }