結果

問題 No.2651 [Cherry 6th Tune B] $\mathbb{C}$omplex комбинат
ユーザー 寝癖寝癖
提出日時 2024-02-23 23:05:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,226 ms / 2,500 ms
コード長 630 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 220,644 KB
最終ジャッジ日時 2024-02-23 23:06:14
合計ジャッジ時間 32,646 ms
ジャッジサーバーID
(参考情報)
judge14 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,332 KB
testcase_01 AC 37 ms
53,332 KB
testcase_02 AC 886 ms
78,940 KB
testcase_03 AC 835 ms
126,164 KB
testcase_04 AC 864 ms
138,648 KB
testcase_05 AC 935 ms
191,184 KB
testcase_06 AC 909 ms
195,340 KB
testcase_07 AC 943 ms
183,548 KB
testcase_08 AC 935 ms
175,452 KB
testcase_09 AC 940 ms
189,700 KB
testcase_10 AC 907 ms
194,148 KB
testcase_11 AC 953 ms
194,736 KB
testcase_12 AC 945 ms
191,452 KB
testcase_13 AC 938 ms
193,096 KB
testcase_14 AC 913 ms
179,284 KB
testcase_15 AC 903 ms
187,864 KB
testcase_16 AC 949 ms
188,648 KB
testcase_17 AC 967 ms
220,432 KB
testcase_18 AC 950 ms
188,128 KB
testcase_19 AC 907 ms
189,892 KB
testcase_20 AC 1,209 ms
80,036 KB
testcase_21 AC 351 ms
116,108 KB
testcase_22 AC 502 ms
147,280 KB
testcase_23 AC 660 ms
182,912 KB
testcase_24 AC 752 ms
185,844 KB
testcase_25 AC 122 ms
79,356 KB
testcase_26 AC 500 ms
148,304 KB
testcase_27 AC 867 ms
220,644 KB
testcase_28 AC 701 ms
191,764 KB
testcase_29 AC 331 ms
123,240 KB
testcase_30 AC 137 ms
81,308 KB
testcase_31 AC 780 ms
184,580 KB
testcase_32 AC 183 ms
94,492 KB
testcase_33 AC 719 ms
179,808 KB
testcase_34 AC 462 ms
137,252 KB
testcase_35 AC 831 ms
189,800 KB
testcase_36 AC 1,226 ms
78,920 KB
testcase_37 AC 884 ms
217,744 KB
testcase_38 AC 856 ms
218,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
mod = 998244353

for _ in range(T):
    N = int(input())
    x, y = [list(i) for i in zip(*[list(map(int, input().split())) for _ in range(N)])]
    A = [(xi*xi+yi*yi)%mod for xi, yi in zip(x, y)]
    B = [(xi*xi-yi*yi)%mod for xi, yi in zip(x, y)]
    C = [(2*xi*yi)%mod for xi, yi in zip(x, y)]

    D = [pow(a, mod-2, mod) for a in A]
    E = [b*b*d for b, d in zip(B, D)]
    F = [b*d for b, d in zip(B, D)]
    G = [c*c*d for c, d in zip(C, D)]
    H = [c*d for c, d in zip(C, D)]

    sd, se, sf, sg, sh = sum(D)%mod, sum(E)%mod, sum(F)%mod, sum(G)%mod, sum(H)%mod
    print((sd*se-sf*sf + sd*sg-sh*sh)%mod)
0