这为啥能过??
查看原帖
这为啥能过??
657194
demaxiya楼主2022/9/24 10:57

这为啥能过??后台数据有点难受呀。。。

#include<iostream>
#include<cstdio>
#include<cstring>

using namespace std;
const int N = 1e5+ 10;

string a[N];

int main()
{

    int n , m;
    cin >> n >> m ;
    for(int i = 1; i <= 100000; i++)
    {
         string s;
         int k = i ;

         while(k)
         {
            s += (k % 15)+'a';
            k/=15;
         }
         a[i] = s;
    }

    for(int i = 1 ; i <= m; i++)
    {
        cout << a[i]<<' ';
    }
    return 0;
    
}
2022/9/24 10:57
加载中...