求大佬debug一下c题

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false),cin.tie(nullptr)
#define int long long
void solve()
{
    int n,m,j=0;
    vector<char> a={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
    cin>>n>>m;
    if(n==m||n-m>26) {cout<<"NO\n";return;}
    cout<<"YES\n";
    for(int i=0;i<n;i++)
    {
        if(i!=m-1) cout<<a[j++];
        else cout<<a[j];
        j%=26;
    }
    cout<<"\n";
}
signed main() {
    IOS;
    int t=1;
    cin>>t;
    while(t--)
    {
        solve();
    }
}

全部评论

相关推荐

记录一下华为笔试,希望不是寄录
投递华为技术有限公司等公司10个岗位
点赞 评论 收藏
分享
真的很糟糕:不一定是你的问题,当然你也可以做的更好一些,继续投相信自己一定会有的
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务