比赛 2024暑假C班集训D 评测结果 AAAAAAAAAA
题目名称 鹰蛋 最终得分 100
用户昵称 ┭┮﹏┭┮ 运行时间 0.142 s
代码语言 C++ 内存使用 3.66 MiB
提交时间 2024-07-13 11:48:19
显示代码纯文本
#include <bits/stdc++.h> 
using namespace std;
#define ll long long
#define in inline 
#define re register
const int N = 1010;
const ll mod = 1e9+7;

ll read(){
    ll x = 0,f = 1;char c = getchar();
    for(;c < '0' || c > '9';c = getchar())if(c == '-')f = -1;
    for(;c >= '0' && c <= '9';c = getchar())x = (x<<1) + (x<<3) + c-'0';
    return x * f;
}

int n,m;
int f[N][12];
int main(){
    freopen("eagleegg.in","r",stdin);
    freopen("eagleegg.out","w",stdout);
    memset(f,0x3f,sizeof f);
    for(int i = 0;i <= 10;i++)f[0][i] = 0;
    for(int i = 1;i <= 1000;i++){
        for(int j = 1;j <= 10;j++)
            for(int k = 1;k <= i;k++)f[i][j] = min(f[i][j],max(f[k-1][j-1],f[i-k][j]) + 1);
    }
    while(1){
        n = read(),m = read();
        if(!n)break;
        if(n > 10)n = 10;
        printf("%d\n",f[m][n]);
    }
    
    
    
    
    return cerr<<clock()<<"ms"<<endl,0;
    
}