Run ID:117268
提交时间:2025-04-15 20:44:20
#include <bits/stdc++.h> using namespace std; int main() { int k; cin>>k; int ct=0; string a; cin>>a; char c=a[0]; for(int i=0; i<a.size(); ++i) { if(a[i]==c) ct++; else { if(ct>=k){ cout<<c; return 0; } else { c=a[i]; ct=1; } } } if(ct>=k){ cout<<c; return 0; } cout<<"No"; return 0; }