結果

問題 No.1500 Super Knight
ユーザー KudeKude
提出日時 2021-05-07 21:51:10
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 1,068 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 77,392 KB
最終ジャッジ日時 2023-10-13 12:53:20
合計ジャッジ時間 4,489 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,324 KB
testcase_01 AC 75 ms
71,296 KB
testcase_02 AC 74 ms
71,068 KB
testcase_03 AC 75 ms
71,436 KB
testcase_04 AC 75 ms
71,348 KB
testcase_05 AC 75 ms
71,468 KB
testcase_06 AC 74 ms
71,392 KB
testcase_07 AC 74 ms
71,340 KB
testcase_08 AC 75 ms
71,372 KB
testcase_09 AC 74 ms
71,592 KB
testcase_10 AC 74 ms
71,080 KB
testcase_11 AC 75 ms
71,324 KB
testcase_12 AC 74 ms
71,288 KB
testcase_13 AC 75 ms
71,384 KB
testcase_14 AC 74 ms
71,232 KB
testcase_15 AC 76 ms
71,284 KB
testcase_16 AC 75 ms
71,452 KB
testcase_17 AC 75 ms
71,408 KB
testcase_18 AC 73 ms
71,332 KB
testcase_19 AC 74 ms
71,280 KB
testcase_20 AC 116 ms
77,392 KB
testcase_21 AC 75 ms
71,460 KB
testcase_22 AC 75 ms
71,320 KB
testcase_23 AC 74 ms
71,456 KB
testcase_24 AC 75 ms
71,612 KB
testcase_25 AC 74 ms
71,252 KB
testcase_26 AC 99 ms
76,720 KB
testcase_27 AC 74 ms
71,252 KB
testcase_28 AC 76 ms
71,664 KB
testcase_29 AC 75 ms
71,540 KB
testcase_30 AC 75 ms
71,596 KB
testcase_31 AC 77 ms
71,600 KB
testcase_32 AC 77 ms
71,328 KB
testcase_33 AC 76 ms
71,288 KB
testcase_34 AC 76 ms
71,288 KB
権限があれば一括ダウンロードができます

ソースコード

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