| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 112017 | 刘佳宇 | 出现k次的字符 | C++ | Wrong Answer | 1 MS | 280 KB | 344 | 2025-03-08 12:03:23 |
#include<bits/stdc++.h> using namespace std; int main(){ string s; int k; cin>>k>>s; int len=s.size(); if(k==1){ cout<<s[0]; return 0; } int t=1; for(int i=0;i<len-1;i++){ if(s[i]==s[i+1]){ t++; if(t==k){ cout<<s[i]; return 0; } } } return 0; }
------Input------
4 kahfgak
------Answer-----
No
------Your output-----