시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 1024 MB | 570 | 364 | 316 | 66.667% |
You are given a string $s$ consisting of lowercase alphabets, and an integer $k$.
Make a new string $t$ by concatenating $k$ copies of $s$. Determine whether $t$ is a palindrome, e.g. is the same backward as forward.
The first line contains a string $s$ consisting of lowercase alphabets. ($1 \le |s| \le 250,000$)
The second line contains an integer $k$. ($1 \le k \le 10^{18}$)
If $t$ is a palindrome, print YES
. If not, print NO
.
abc 3
NO
abba 1
YES
University > KAIST > 2018 KAIST 8th ACM-ICPC Mock Competition I번