結果
| 問題 | No.3428 Palindromic Path (Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-15 16:16:27 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 179 ms / 2,000 ms |
| コード長 | 456 bytes |
| 記録 | |
| コンパイル時間 | 399 ms |
| コンパイル使用メモリ | 82,088 KB |
| 実行使用メモリ | 76,780 KB |
| 最終ジャッジ日時 | 2026-01-15 16:16:29 |
| 合計ジャッジ時間 | 2,078 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
N = int(input())
C = [input() for _ in range(N)]
M = 2 * N - 2
ans = 0
for i in range(1 << M):
res = [C[0][0]]
x = y = 0
for j in range(M):
if i >> j & 1:
x += 1
if x == N:
break
else:
y += 1
if y == N:
break
res.append(C[y][x])
if not x == y == N - 1:
continue
ans += all(a == b for a, b in zip(res, res[::-1]))
print(ans)