Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
120178 吴天辰 出现k次的字符 C++ Accepted 1 MS 276 KB 269 2025-05-24 11:38:17

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ char a[2550]; int k,t=1; cin>>k; cin>>a+1; int len=strlen(a+1); for(int i=1;i<=len;i++){ if(t>=k){ cout<<a[i]; return 0; } if(a[i]==a[i+1]) t++; else t=1; } cout<<"No"; return 0; }