結果

問題 No.1824 門\松\列
ユーザー U SU S
提出日時 2022-01-28 21:42:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 815 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 89,644 KB
最終ジャッジ日時 2023-08-28 19:31:17
合計ジャッジ時間 1,857 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
86,264 KB
testcase_01 AC 129 ms
86,244 KB
testcase_02 AC 143 ms
87,080 KB
testcase_03 AC 190 ms
89,644 KB
testcase_04 AC 149 ms
87,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys
# input = sys.stdin.readline
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))
def mps(A):return [tuple(map(int, input().split())) for _ in range(A)]
def stoi(LIST):return list(map(int,LIST))
def itos(LIST):return list(map(str,LIST))
def bitA(X,A):return X & 1<<A == 1<<A
import math
import bisect
import heapq
import time
from copy import copy as cc
from copy import deepcopy as dc
from itertools import accumulate, product
from collections import Counter, defaultdict, deque
def ceil(U,V):return (U+V-1)//V
def modf1(N,MOD):return (N-1)%MOD+1
inf = int(1e18+20)
mod = int(1e9+7)

t = int(input())
a = [0]*(10**6+1)
a[3] = 4
for i in range(4, 10**6+1):
    num = (i-2)*(i-1)//2
    a[i] = a[i-1]+num*4
for _ in range(t):
    n = int(input())
    print(a[n])




0