Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
118627 | Kevin | 出现k次的字符 | C++ | Accepted | 1 MS | 276 KB | 294 | 2025-05-08 11:31:19 |
#include<bits/stdc++.h> using namespace std; int main(){ int k,t=1; char s[2500]; cin>>k; cin>>s; int len=strlen(s); for(int i=0;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; }