Submission #35789


ソースコード

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
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)
#define outl(x) cout<< (x) << '\n'
#define fi first
#define se second
using pii = pair<int,int>;
using ll = long long;
char s[257], w[267];
char cat[522] = "";
int main()
{
cin.tie(0), ios::sync_with_stdio(false);
cin >> w >> s;
strcat(cat, s);
strcat(cat, s);
bool found = false;
if ( strstr(cat, w) == NULL) {
reverse(cat, cat + strlen(cat));
outl( strstr(cat, w) == NULL ? "NO" : "YES" );
} else {
outl( "YES" );
}
}

ステータス

項目 データ
問題 0938 - 魔剤が飲みたい
ユーザー名 Arumakan_ei1727
投稿日時 2018-05-15 17:48:43
言語 C++11
状態 Accepted
得点 1
ソースコード長 661 Byte
最大実行時間 31 ms
最大メモリ使用量 700 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
case1.txt AC 28 ms 480 KB
1
case2.txt AC 22 ms 700 KB
1
reverse1.txt AC 18 ms 532 KB
1
reverse2.txt AC 21 ms 492 KB
1
test1.txt AC 19 ms 584 KB
1
test2.txt AC 31 ms 544 KB
1
test3.txt AC 20 ms 628 KB
1