結果

問題 No.1491 銀将
ユーザー moharan627moharan627
提出日時 2021-04-30 21:56:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 1,000 ms
コード長 589 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 8,288 KB
最終ジャッジ日時 2023-09-26 05:58:54
合計ジャッジ時間 1,473 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,116 KB
testcase_01 AC 15 ms
7,792 KB
testcase_02 AC 15 ms
7,860 KB
testcase_03 AC 16 ms
7,832 KB
testcase_04 AC 16 ms
7,956 KB
testcase_05 AC 15 ms
7,844 KB
testcase_06 AC 15 ms
7,812 KB
testcase_07 AC 16 ms
7,812 KB
testcase_08 AC 15 ms
7,740 KB
testcase_09 AC 16 ms
7,792 KB
testcase_10 AC 17 ms
7,792 KB
testcase_11 AC 16 ms
7,772 KB
testcase_12 AC 16 ms
7,864 KB
testcase_13 AC 16 ms
8,288 KB
testcase_14 AC 16 ms
7,908 KB
testcase_15 AC 16 ms
7,816 KB
testcase_16 AC 16 ms
7,852 KB
testcase_17 AC 16 ms
7,908 KB
testcase_18 AC 16 ms
7,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LC(): return list(input())
def IC(): return [int(c) for c in input()]
def MI(): return map(int, sys.stdin.readline().split())
INF = float('inf')
MOD = 10**9 + 7
def solve():
    K = II()
    if(K==1):
        print(6)
        exit()
    elif(K==2):
        print(18)
        exit()
    #少なくとも、(2K-3)**2以上
    Ans = (2*K-3)**2 + 6*K-7 + K +2*K+1 + 2*(K-1) + K+1
    print(Ans)
    return
solve()
0