Submission #38008
ソースコード
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 | #include<stdio.h> #include<string.h> int main() { char s[257],t[257],str[600]= "" ,temp; scanf ( "%s%s" ,s,t); while ( strlen (str)< strlen (s)){ strcat (str,t); } strcat (str,t); if ( strstr (str,s)!=0){ printf ( "YES\n" ); } else { int i; for (i=0;i< strlen (str)/2;i++){ temp=str[i]; str[i]=str[ strlen (str)-1-i]; str[ strlen (str)-1-i]=temp; } if ( strstr (str,s)!=0){ printf ( "YES\n" ); } else printf ( "NO\n" ); } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0938 - 魔剤が飲みたい |
ユーザー名 | ei1832 |
投稿日時 | 2018-07-04 13:48:27 |
言語 | C++11 |
状態 | Accepted |
得点 | 1 |
ソースコード長 | 501 Byte |
最大実行時間 | 44 ms |
最大メモリ使用量 | 572 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 1 / 1 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
case1.txt | AC | 44 ms | 480 KB |
1
|
case2.txt | AC | 24 ms | 464 KB |
1
|
reverse1.txt | AC | 25 ms | 572 KB |
1
|
reverse2.txt | AC | 24 ms | 424 KB |
1
|
test1.txt | AC | 20 ms | 408 KB |
1
|
test2.txt | AC | 20 ms | 516 KB |
1
|
test3.txt | AC | 19 ms | 500 KB |
1
|