結果

問題 No.1500 Super Knight
ユーザー KudeKude
提出日時 2021-05-07 21:51:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 82,516 KB
実行使用メモリ 76,288 KB
最終ジャッジ日時 2024-09-15 09:43:17
合計ジャッジ時間 2,984 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
if n <= 4:
    d = [(3, 0), (3, 2), (2, 3), (0, 3), (-2, 3), (-3, 2), (-3, 0), (-3, -2), (-2, -3), (0, -3), (2, -3), (3, -2)]
    from itertools import product
    s = set()
    for p in product(d, repeat=n):
        x = sum(dx for dx, dy in p)
        y = sum(dy for dx, dy in p)
        s.add((x, y))
    print(len(s))
    exit()
ans = (5 * n + 1) ** 2 - 4 * (2 * n + 1) * n
print(ans % (10 ** 9 + 7))
0