站外题 43pts TLE 求调 玄1关

灌水区

从高位一位一位判定就行了呗
by __Aaaaaaaa @ 2024-04-10 19:55:22


@[__Aaaaaaaa](/user/338880) 所以具体咋实现 ~~话说您是不是过于轻描淡写了(bushi~~
by a_little_carrot @ 2024-04-10 20:00:23


``` #include <iostream> #include <cstdio> using namespace std; typedef long long ll; const int N=110; int n,m,a[N]; ll k,C[N][N]; int main(){ for(int i=0;i<=60;++i){ for(int j=0;j<=i;++j){ C[i][j]=j==0?1:C[i-1][j-1]+C[i-1][j]; } } cin>>n>>m>>k; int s=n+m; for(int i=1;i<=s;++i){ int c=C[n+m-1][n]; if(k>c){ k-=c; --n; putchar('b'); } else{ putchar('a'); --m; } } return 0; } ```
by __Aaaaaaaa @ 2024-04-10 20:03:39


@[a_little_carrot](/user/1042960)
by __Aaaaaaaa @ 2024-04-10 20:03:55


@[__Aaaaaaaa](/user/338880) 感谢 已关
by a_little_carrot @ 2024-04-10 20:04:27


emm似乎要高精度
by __Aaaaaaaa @ 2024-04-10 20:04:49


@[__Aaaaaaaa](/user/338880) 然后似乎14pts
by a_little_carrot @ 2024-04-10 20:05:54


``` #include <iostream> #include <cstdio> using namespace std; typedef long long ll; const int N=110; int n,m,a[N]; ll k,C[N][N]; int main(){ for(int i=0;i<=60;++i){ for(int j=0;j<=i;++j){ C[i][j]=j==0?1:C[i-1][j-1]+C[i-1][j]; } } cin>>n>>m>>k; int s=n+m; for(int i=1;i<=s;++i){ ll c=C[n+m-1][n]; if(k>c){ k-=c; --n; putchar('b'); } else{ putchar('a'); --m; } } return 0; } ```
by __Aaaaaaaa @ 2024-04-10 20:06:08


因为我没开LL
by __Aaaaaaaa @ 2024-04-10 20:06:28


@[__Aaaaaaaa](/user/338880) 29了( 我还是试试加点火车头叭
by a_little_carrot @ 2024-04-10 20:09:57


| 下一页