結果

問題 No.1500 Super Knight
ユーザー titiatitia
提出日時 2021-05-07 21:41:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 290 ms / 2,000 ms
コード長 554 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 10,864 KB
実行使用メモリ 16,892 KB
最終ジャッジ日時 2023-10-13 12:42:12
合計ジャッジ時間 11,454 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 276 ms
16,828 KB
testcase_01 AC 272 ms
16,744 KB
testcase_02 AC 274 ms
16,828 KB
testcase_03 AC 259 ms
16,804 KB
testcase_04 AC 263 ms
16,792 KB
testcase_05 AC 270 ms
16,780 KB
testcase_06 AC 272 ms
16,788 KB
testcase_07 AC 274 ms
16,740 KB
testcase_08 AC 267 ms
16,892 KB
testcase_09 AC 270 ms
16,744 KB
testcase_10 AC 274 ms
16,828 KB
testcase_11 AC 290 ms
16,808 KB
testcase_12 AC 275 ms
16,872 KB
testcase_13 AC 272 ms
16,800 KB
testcase_14 AC 268 ms
16,768 KB
testcase_15 AC 274 ms
16,888 KB
testcase_16 AC 270 ms
16,844 KB
testcase_17 AC 270 ms
16,832 KB
testcase_18 AC 288 ms
16,852 KB
testcase_19 AC 272 ms
16,764 KB
testcase_20 AC 274 ms
16,740 KB
testcase_21 AC 280 ms
16,852 KB
testcase_22 AC 268 ms
16,892 KB
testcase_23 AC 278 ms
16,748 KB
testcase_24 AC 272 ms
16,892 KB
testcase_25 AC 266 ms
16,740 KB
testcase_26 AC 289 ms
16,772 KB
testcase_27 AC 276 ms
16,800 KB
testcase_28 AC 281 ms
16,840 KB
testcase_29 AC 268 ms
16,740 KB
testcase_30 AC 270 ms
16,856 KB
testcase_31 AC 270 ms
16,836 KB
testcase_32 AC 268 ms
16,844 KB
testcase_33 AC 277 ms
16,844 KB
testcase_34 AC 276 ms
16,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

mod=10**9+7

Q=[(0,0)]

ANS=[1]

for i in range(20):
    NQ=[]
    for a,b in Q:
        for z,w in [(a+3, b), (a+3, b+2), (a+2, b+3), (a, b+3), (a-2, b+3), (a-3, b+2),(a-3, b), (a-3, b-2), (a-2, b-3), (a, b-3), (a+2, b-3), (a+3, b-2)]:
            NQ.append((z,w))

    Q=set(NQ)
    #print(len(Q))
    ANS.append((len(Q)))

N=int(input())

if N<=20:
    print(ANS[N])
    exit()

B=[1,11,53,107,125,159,193,227,261]

# B_nは?

#print(B[4]+(N-4)*34)
x=B[4]+(N-4)*34
print((1+11+53+107+(x+B[4])*(N-4+1)//2)%mod)
0