結果

問題 No.1491 銀将
ユーザー qwewe
提出日時 2025-05-14 13:20:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 49 ms / 1,000 ms
コード長 241 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2025-05-14 13:22:21
合計ジャッジ時間 2,012 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def main():
    K = int(sys.stdin.readline())

    if K == 0:
        print(1)
    else:
        # For K >= 1, the formula derived is 4*K^2 + 2
        ans = 4 * K * K + 2
        print(ans)

if __name__ == '__main__':
    main()
0