結果
問題 | No.1491 銀将 |
ユーザー | moharan627 |
提出日時 | 2021-04-30 21:56:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 28 ms / 1,000 ms |
コード長 | 589 bytes |
コンパイル時間 | 390 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-19 01:20:40 |
合計ジャッジ時間 | 1,284 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
import sysinput = sys.stdin.readlinesys.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 + 7def 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+1print(Ans)returnsolve()