Submission #36014


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void Reverce(char b[],int len);
int main(){
char a[10000],b[10000],z[1000];
int len;
scanf("%s",a);
scanf("%s",b);
strcpy(z,b);
strcat(b,z);
len=strlen(b);
if(strstr(b,a)!=NULL ){
printf("YES\n");
}else{
Reverce(b,len);
if(strstr(b,a)!=NULL){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
}
void Reverce(char b[],int len){
int i=0,j=len-1;
while(i<j){
char temp=b[j];
b[j]=b[i];
b[i]=temp;
i++;
j--;
}
return;
}

ステータス

項目 データ
問題 0938 - 魔剤が飲みたい
ユーザー名 Zzz..ei1704..Zzz
投稿日時 2018-05-25 15:50:03
言語 C++11
状態 Accepted
得点 1
ソースコード長 604 Byte
最大実行時間 26 ms
最大メモリ使用量 580 KB

セット

セット 得点 Cases
1 ALL 1 / 1 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
case1.txt AC 24 ms 476 KB
1
case2.txt AC 26 ms 440 KB
1
reverse1.txt AC 24 ms 532 KB
1
reverse2.txt AC 19 ms 492 KB
1
test1.txt AC 24 ms 580 KB
1
test2.txt AC 23 ms 544 KB
1
test3.txt AC 25 ms 520 KB
1