Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109628 | 陈铎文 | 出现k次的字符 | C++ | Wrong Answer | 1 MS | 276 KB | 332 | 2025-02-10 09:03:44 |
#include<bits/stdc++.h> using namespace std; int main(){ char a[301]; int m=0; int k; cin>>k; cin>>a; bool t=false; for(int i=1;i<=strlen(a);i++){ for(int j=i+1;j<=k+i;j++){ if(a[i]==a[j]){ m++; } } if(m==k){ cout<<a[i]; t=true; break; } } if(t==false){ cout<<"No"; } }
------Input------
5 aaaaaaf
------Answer-----
a
------Your output-----
No