Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
157712 Kevin 出现k次的字符 C++ Wrong Answer 1 MS 276 KB 327 2026-08-15 16:32:00

Tests(1/10):


Code:

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


Run Info:

------Input------
2 aabbcc
------Answer-----
a
------Your output-----
No