Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
118628 | Kevin | 出现k次的字符 | C++ | Accepted | 1 MS | 280 KB | 299 | 2025-05-08 11:37:22 |
#include<bits/stdc++.h> using namespace std; int main(){ int k,t=1; char s[2600]; cin>>k; cin>>s+1; int len=strlen(s+1); for(int i=1;i<=len;i++){ if(t>=k){ cout<<s[i]; return 0; } if(s[i]==s[i+1]){ t++; } else{ t=1; } } cout<<"No"; return 0; }