QOJ.ac

QOJ

時間限制: 1.0 s 記憶體限制: 1024 MB 總分: 100 可 Hack ✓

#17870. 重复回文

统计

给你一个由小写字母组成的字符串 $s$ 和一个整数 $k$。

通过将 $k$ 个 $s$ 拼接在一起构造一个新字符串 $t$。判断 $t$ 是否为回文串(即正着读和反着读都一样)。

输入格式

第一行包含一个由小写字母组成的字符串 $s$。($1 \le |s| \le 250000$)

第二行包含一个整数 $k$。($1 \le k \le 10^{18}$)

输出格式

如果 $t$ 是回文串,输出 YES。否则,输出 NO

样例

输入样例 1

abc
3

输出样例 1

NO

输入样例 2

abba
1

输出样例 2

YES

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.