結果

問題 No.1500 Super Knight
コンテスト
ユーザー Kude
提出日時 2021-05-07 21:51:10
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 420 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 232 ms
コンパイル使用メモリ 84,940 KB
実行使用メモリ 80,940 KB
最終ジャッジ日時 2026-04-04 19:02:28
合計ジャッジ時間 1,980 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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