代码。。能力。。为何。。这么。。弱。。

英语。。为何。。这么。。渣。。

前期打的非常顺,在1个小时的时候甚至到了200+名,然而。。我为何这么弱

A.Cutting Banner

 我看错了题意,然而却A掉了,一个串只能切一次,后来Hack+4也是靠的这个

 1 #include<stdio.h>
 2 #include<string.h>
 3 #include<algorithm>
 4 using namespace std;
 5 char s[1005],t[1005],y[1005];
 6 int main()
 7 {
 8   int i,len,tmp,j,k,x;
 9   scanf("%s",s);
10   strcpy(t,"CODEFORCES");
11   if (strcmp(s,t)==0){printf("YES\n"); return 0; }
12   len=strlen(s);
13   for (i=0;i<len;i++)
14     for (j=i;j<len;j++)
15     {
16       x=-1;
17       for (k=0;k<len;k++)
18         if (k<i||k>j) y[++x]=s[k];
19       y[x+1]='\0';
20       if (strcmp(y,t)==0){printf("YES\n"); return 0; }
21     }
22   printf("NO\n");
23   return 0;
24 }
View Code

相关文章:

  • 2021-11-21
  • 2021-11-17
  • 2022-01-11
  • 2022-03-06
  • 2021-09-11
  • 2022-02-26
  • 2021-09-22
猜你喜欢
  • 2021-06-25
  • 2021-06-14
  • 2021-12-19
  • 2022-02-17
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案