Skip to content

Commit 63c337f

Browse files
committed
🥺chore
1 parent 2dbec4a commit 63c337f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

abc159/b/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ def LSR(n): return [LS() for i in range(n)]
1919
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
2020
MOD = 1000000007
2121

22+
def is_parindrome(s):
23+
for i in range(math.ceil(len(s)/2)):
24+
if s[i] != s[-i-1]: return False
25+
return True
26+
2227
def main():
23-
N = I()
28+
s = S()
29+
print("Yes" if is_parindrome(s) and is_parindrome(s[:(len(s)-1)//2]) and is_parindrome(s[(len(s)+1)//2:]) else "No")
30+
2431

2532
if __name__ == '__main__':
2633
main()

0 commit comments

Comments
 (0)