1 条题解

  • 0
    @ 2025-12-23 20:45:05
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int t=0,maxx=INT_MIN;
    	string s,g;
    	getline(cin,s);
    	s.erase(s.size()-1);
    	s=s+' ';
    	for(int i=0;i<s.size();i++){
    		if(s[i]!=' ') t++;
    		else{
    			string k=s.substr(i-t,t);
    			if(k.find('a')!=-1&&maxx<t) maxx=max(maxx,t),g=k;
    			t=0;
    		}
    	}
    	if(!g.empty()) cout<<g;
    	else cout<<"NO";
    	return 0;
    }
    
    • 1

    信息

    ID
    112
    时间
    1000ms
    内存
    16MiB
    难度
    6
    标签
    (无)
    递交数
    550
    已通过
    159
    上传者