• 大小: 18.92MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-07
  • 语言: 其他
  • 标签: NOI  NOIP  

资源简介

2016山东省NOI省队集训DAY7 题目题解数据标程 NOIP省选省队集训

资源截图

代码片段和文件信息

#include
#include
#include
#include
using namespace std;
long long dp[20][10][10];
int yu[20][10][10];
char dr[20];
int xu[20];
int n;
void Init()
{
    int ijks;
    for(i=0;i<=9;i++)
    {
        for(j=0;j<=9;j++)
        {
            if(i            {
                dp[1][i][j]=1;
                yu[1][i][j]=10+i-j;
            }
            else
            {
                dp[1][i][j]=2;
                yu[1][i][j]=10-j;
            }
        }
    }
    for(i=2;i<=18;i++)
    {
        for(j=0;j<=9;j++)
        {
            for(k=0;k<=9;k++)
            {
                yu[i][j][k]=j;
                for(s=9;s>=0;s--)
                {
                    dp[i][j][k]+=dp[i-1][yu[i][j][k]][max(ks)];
                    yu[i][j][k]=yu[i-1][yu[i][j][k]][max(ks)];
                }
            }
        }
    }
}
void Do()
{
    int ij;
    scanf(“%s“dr);
    n=strlen(dr);
    for(i=1;i<=n;i++)
        xu[i]=dr[n-i]-‘0‘;
    int now=xu[1];
    long long ans=0;
    for(i=2;i<=n;i++)
    {
        while(xu[i]!=9)
        {
            int mz=0;
            for(j=i;j<=n;j++)
                mz=max(mzxu[j]);
            if(!mz)
                break;
            ans+=dp[i-1][now][mz];
            now=yu[i-1][now][mz];
            xu[i]--;
            for(j=i;xu[j]<0;j++)
            {
                xu[j]=9;
                xu[j+1]--;
            }
        }
    }
    for(i=n;i>=2;i--)
    {
        while(xu[i])
        {
            ans+=dp[i-1][now][xu[i]];
            now=yu[i-1][now][xu[i]];
            xu[i]--;
        }
    }
    if(now)
        ans++;
    cout<}
int main()
{
freopen(“number.in““r“stdin);
freopen(“number.out““w“stdout);
    Init();
    Do();
    return 0;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-04-18 15:02  data\
     目录           0  2019-04-08 23:03  data\number\
     文件           8  2016-05-29 14:02  data\number\number1.in
     文件           7  2016-05-29 14:02  data\number\number1.out
     文件          20  2016-05-29 14:02  data\number\number10.in
     文件          20  2016-05-29 14:02  data\number\number10.out
     文件           8  2016-05-29 14:02  data\number\number2.in
     文件           8  2016-05-29 14:02  data\number\number2.out
     文件           8  2016-05-29 14:02  data\number\number3.in
     文件           7  2016-05-29 14:02  data\number\number3.out
     文件          14  2016-05-29 14:02  data\number\number4.in
     文件          13  2016-05-29 14:02  data\number\number4.out
     文件          14  2016-05-29 14:02  data\number\number5.in
     文件          13  2016-05-29 14:02  data\number\number5.out
     文件          14  2016-05-29 14:02  data\number\number6.in
     文件          14  2016-05-29 14:02  data\number\number6.out
     文件          20  2016-05-29 14:02  data\number\number7.in
     文件          20  2016-05-29 14:02  data\number\number7.out
     文件          20  2016-05-29 14:02  data\number\number8.in
     文件          20  2016-05-29 14:02  data\number\number8.out
     文件          20  2016-05-29 14:02  data\number\number9.in
     文件          19  2016-05-29 14:02  data\number\number9.out
     目录           0  2019-04-08 23:03  data\painting\
     文件          38  2016-05-29 14:02  data\painting\painting.in
     文件           5  2016-05-29 14:02  data\painting\painting.out
     文件      115305  2016-05-29 14:02  data\painting\painting1.in
     文件          12  2016-05-29 14:02  data\painting\painting1.out
     文件     2557533  2016-05-29 14:02  data\painting\painting10.in
     文件          19  2016-05-29 14:02  data\painting\painting10.out
     文件      114264  2016-05-29 14:02  data\painting\painting2.in
     文件          11  2016-05-29 14:02  data\painting\painting2.out
............此处省略44个文件信息

评论

共有 条评论