| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 152911 | 左锶焜 | 出现k次的字符 | C++ | Accepted | 1 MS | 276 KB | 536 | 2026-05-05 19:16:41 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int k,s=1; char a[2501]; cin>>k>>a; for(int i=0;i<=strlen(a)-2;i++){ if(a[i]==a[i+1]){ s++;} else{ if(s>=k){ cout<<a[i];return 0; } s=1; } } cout<<"No"; return 0; }