結果

問題 No.1500 Super Knight
コンテスト
ユーザー Kude
提出日時 2021-05-07 21:51:10
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 93 ms / 2,000 ms
+ 750µs
コード長 420 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 268 ms
コンパイル使用メモリ 96,232 KB
実行使用メモリ 84,992 KB
最終ジャッジ日時 2026-08-27 22:18:20
合計ジャッジ時間 4,240 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_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