CF1107A

其实这种题目很能投机取巧的。在这里,你就只要特判一下输出NO的情况就行了,其他的输出YES,分成两段就可以了。  

#include<bits/stdc++.h>
using namespace std;
int a[301]={0};
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,last=0;
        cin>>n;
        string s;
        cin>>s;
        if(n==2&&s[0]>=s[1])
        {
            cout<<"NO"<<endl;
            continue;
        }
        cout<<"YES"<<endl<<2<<endl;
        cout<<s[0]<<" ";
        for(int i=1;i<n;i++)cout<<s[i];cout<<endl;
    }
    return 0;
}

  

猜你喜欢

转载自www.cnblogs.com/shierjie/p/10326213.html