結果

問題 No.2600 Avator Height
ユーザー anonymouslyanonymously
提出日時 2024-01-12 21:35:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,316 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 30,436 KB
最終ジャッジ日時 2024-01-12 21:36:30
合計ジャッジ時間 34,999 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 257 ms
30,436 KB
testcase_01 AC 1,316 ms
30,436 KB
testcase_02 AC 1,266 ms
30,436 KB
testcase_03 AC 1,246 ms
30,436 KB
testcase_04 AC 1,266 ms
30,436 KB
testcase_05 AC 1,309 ms
30,436 KB
testcase_06 AC 1,278 ms
30,436 KB
testcase_07 AC 1,268 ms
30,436 KB
testcase_08 AC 1,285 ms
30,436 KB
testcase_09 AC 1,252 ms
30,436 KB
testcase_10 AC 1,296 ms
30,436 KB
testcase_11 AC 1,266 ms
30,436 KB
testcase_12 AC 1,297 ms
30,436 KB
testcase_13 AC 1,272 ms
30,436 KB
testcase_14 AC 1,268 ms
30,436 KB
testcase_15 AC 1,273 ms
30,436 KB
testcase_16 AC 1,302 ms
30,436 KB
testcase_17 AC 1,271 ms
30,436 KB
testcase_18 AC 1,282 ms
30,436 KB
testcase_19 AC 1,270 ms
30,436 KB
testcase_20 AC 1,290 ms
30,436 KB
testcase_21 AC 1,306 ms
30,436 KB
testcase_22 AC 1,278 ms
30,436 KB
testcase_23 AC 1,290 ms
30,436 KB
testcase_24 AC 1,209 ms
30,436 KB
testcase_25 AC 1,244 ms
30,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=998244353
N=200000
R=[None,1,1]
E=[None,1,3]
D=[None]
for r,e in zip(R[1:],E[1:]):
	d=(5*r*r-e*e)%M
	if d<0:
		d+=M
	D.append(d)
	
	
for i in range(3,N+1):
	R.append((R[-1]+R[-2])%M)
	E.append((E[-1]+E[-2])%M)
	d=(5*R[i]*R[i]-E[i]*E[i])%M
	if d<0:
		d+=M
	D.append(d)

Q=int(input())
for _ in range(Q):
	n=int(input())
	print(D[n])
0