Submission #38514


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<bits/stdc++.h>
using namespace std;
int main(){
string s,str;
cin>>s>>str;
string rstr=str;
reverse(rstr.begin(),rstr.end());
str+=str;
rstr+=rstr;
if(str.find(s)==std::string::npos&&rstr.find(s)==std::string::npos){
cout<<"NO"<<endl;
}
else{
cout<<"YES"<<endl;
}
return(0);
}

ステータス

項目 データ
問題 0938 - 魔剤が飲みたい
ユーザー名 r1705
投稿日時 2018-07-10 16:58:33
言語 C++11
状態 Accepted
得点 1
ソースコード長 333 Byte
最大実行時間 32 ms
最大メモリ使用量 700 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
case1.txt AC 17 ms 476 KB
1
case2.txt AC 28 ms 700 KB
1
reverse1.txt AC 21 ms 548 KB
1
reverse2.txt AC 20 ms 652 KB
1
test1.txt AC 31 ms 504 KB
1
test2.txt AC 27 ms 612 KB
1
test3.txt AC 32 ms 588 KB
1