結果

問題 No.2406 Difference of Coordinate Squared
ユーザー ニックネームニックネーム
提出日時 2023-08-04 22:58:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 536 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 77,824 KB
最終ジャッジ日時 2024-04-22 21:20:31
合計ジャッジ時間 5,579 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
52,224 KB
testcase_01 AC 105 ms
75,520 KB
testcase_02 AC 116 ms
77,824 KB
testcase_03 WA -
testcase_04 AC 102 ms
77,312 KB
testcase_05 AC 78 ms
59,360 KB
testcase_06 AC 78 ms
67,568 KB
testcase_07 AC 78 ms
66,156 KB
testcase_08 AC 81 ms
69,888 KB
testcase_09 AC 89 ms
72,064 KB
testcase_10 AC 88 ms
74,496 KB
testcase_11 AC 98 ms
71,808 KB
testcase_12 AC 102 ms
72,984 KB
testcase_13 AC 94 ms
74,112 KB
testcase_14 AC 88 ms
73,856 KB
testcase_15 AC 91 ms
75,264 KB
testcase_16 AC 79 ms
69,504 KB
testcase_17 AC 45 ms
52,352 KB
testcase_18 WA -
testcase_19 AC 97 ms
73,344 KB
testcase_20 AC 77 ms
75,264 KB
testcase_21 AC 87 ms
68,480 KB
testcase_22 WA -
testcase_23 AC 92 ms
75,776 KB
testcase_24 AC 61 ms
63,872 KB
testcase_25 WA -
testcase_26 AC 45 ms
52,736 KB
testcase_27 WA -
testcase_28 AC 50 ms
52,736 KB
testcase_29 AC 43 ms
52,604 KB
testcase_30 AC 45 ms
52,864 KB
testcase_31 AC 48 ms
52,352 KB
testcase_32 AC 42 ms
52,736 KB
testcase_33 AC 44 ms
52,224 KB
testcase_34 AC 49 ms
52,480 KB
testcase_35 AC 45 ms
52,992 KB
testcase_36 AC 47 ms
52,224 KB
testcase_37 AC 48 ms
52,480 KB
testcase_38 AC 47 ms
52,736 KB
testcase_39 WA -
testcase_40 AC 49 ms
52,608 KB
testcase_41 AC 43 ms
52,736 KB
testcase_42 WA -
testcase_43 AC 48 ms
52,736 KB
testcase_44 AC 45 ms
52,480 KB
testcase_45 AC 43 ms
52,664 KB
testcase_46 AC 50 ms
52,352 KB
testcase_47 AC 46 ms
52,992 KB
testcase_48 WA -
testcase_49 AC 49 ms
52,748 KB
testcase_50 AC 42 ms
52,096 KB
testcase_51 AC 45 ms
52,736 KB
testcase_52 AC 43 ms
52,224 KB
testcase_53 AC 44 ms
52,352 KB
testcase_54 AC 45 ms
52,352 KB
testcase_55 AC 42 ms
52,736 KB
testcase_56 AC 47 ms
52,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
nmax = n; mod = 998244353; fa = [1]*(nmax+1); fi = [1]*(nmax+1)
for i in range(1,nmax): fa[i+1] = fa[i]*(i+1)%mod
fi[nmax] = pow(fa[nmax],mod-2,mod)
for i in range(nmax,0,-1): fi[i-1] = fi[i]*i%mod
def cmb(n,r): return fa[n]*fi[n-r]%mod*fi[r]%mod if 0<=r<=n else 0
m = abs(m); ans = 0
for i in range(1,int(m**0.5)+1):
    if i*i>m: break
    j = m//i
    if m%i or i%2!=n%2 or j%2!=n%2: continue
    x = cmb(n,(n+i)//2)*cmb(n,(n+j)//2)%mod
    ans += x if i==j else 2*x
print(2*ans*pow(4,mod-1-n,mod)%mod)
0