結果

問題 No.1348 Split Tile
ユーザー mkawa2mkawa2
提出日時 2021-09-15 18:01:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 783 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 47,452 KB
最終ジャッジ日時 2023-09-11 04:17:53
合計ジャッジ時間 7,000 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,796 KB
testcase_01 AC 17 ms
8,256 KB
testcase_02 AC 31 ms
10,432 KB
testcase_03 AC 270 ms
43,456 KB
testcase_04 AC 199 ms
33,852 KB
testcase_05 AC 70 ms
15,428 KB
testcase_06 AC 43 ms
11,812 KB
testcase_07 AC 290 ms
47,328 KB
testcase_08 AC 210 ms
35,304 KB
testcase_09 AC 186 ms
32,388 KB
testcase_10 AC 266 ms
43,656 KB
testcase_11 AC 44 ms
11,960 KB
testcase_12 AC 153 ms
27,312 KB
testcase_13 AC 229 ms
36,616 KB
testcase_14 AC 160 ms
28,340 KB
testcase_15 AC 232 ms
38,584 KB
testcase_16 AC 152 ms
26,736 KB
testcase_17 AC 89 ms
18,324 KB
testcase_18 AC 208 ms
34,576 KB
testcase_19 AC 135 ms
24,996 KB
testcase_20 AC 145 ms
26,308 KB
testcase_21 AC 124 ms
22,620 KB
testcase_22 AC 272 ms
43,740 KB
testcase_23 AC 276 ms
45,108 KB
testcase_24 AC 268 ms
43,688 KB
testcase_25 AC 296 ms
46,628 KB
testcase_26 AC 289 ms
44,748 KB
testcase_27 AC 302 ms
47,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = 10**16
md = 998244353
# md = 10**9+7

n = II()

fac = [1]
for i in range(1, n+1):
    fac.append(fac[-1]*i%md)

ans = n*(n-1)//2%md*fac[n-1]%md+(n-1)*n*(n+1)//6%md*fac[n-2]%md*(n-1)%md
ans %= md

print(ans)
0