Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
120402 | 黄睿杰 | 出现k次的字符 | C++ | Accepted | 1 MS | 276 KB | 295 | 2025-05-25 16:57:05 |
#include<iostream> #include<cstring> using namespace std; char s[10000]; int main(){ int k,t=1; cin>>k>>s+1; int l=strlen(s+1); for(int i=1;i<=l;i++){ if(t>=k){ cout<<s[i]; return 0; } if(s[i]==s[i+1]) t++; else t=1; } cout<<"No"; return 0; }