通过观察样例发现字符串可能有空格,所以我们要用 getline 来进行输入,剩下就没别的了。
#include <bits/stdc++.h>
using namespace std ;
string s ;
int main() {
getline(cin , s) ;
cout << (s.find("79XD") != -1 ? "79XD" : "Codeforces") ;
return 0 ;
}
设 为字符串 的长度。
- 时间复杂度: 或者 。
- 空间复杂度:。
- 难度:中位红/上位红。
暂无评论