結果

問題 No.2651 [Cherry 6th Tune B] $\mathbb{C}$omplex комбинат
ユーザー titiatitia
提出日時 2024-02-29 02:25:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,937 ms / 2,500 ms
コード長 529 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 113,136 KB
最終ジャッジ日時 2024-04-24 15:59:21
合計ジャッジ時間 58,873 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 41 ms
51,968 KB
testcase_02 AC 1,655 ms
77,736 KB
testcase_03 AC 1,838 ms
97,292 KB
testcase_04 AC 1,937 ms
97,464 KB
testcase_05 AC 1,870 ms
111,356 KB
testcase_06 AC 1,850 ms
110,908 KB
testcase_07 AC 1,836 ms
110,004 KB
testcase_08 AC 1,841 ms
109,972 KB
testcase_09 AC 1,837 ms
110,640 KB
testcase_10 AC 1,871 ms
113,136 KB
testcase_11 AC 1,821 ms
109,876 KB
testcase_12 AC 1,819 ms
107,520 KB
testcase_13 AC 1,826 ms
110,408 KB
testcase_14 AC 1,832 ms
109,344 KB
testcase_15 AC 1,830 ms
111,068 KB
testcase_16 AC 1,815 ms
109,832 KB
testcase_17 AC 1,806 ms
109,524 KB
testcase_18 AC 1,823 ms
110,004 KB
testcase_19 AC 1,806 ms
109,568 KB
testcase_20 AC 1,704 ms
77,736 KB
testcase_21 AC 615 ms
87,540 KB
testcase_22 AC 987 ms
94,720 KB
testcase_23 AC 1,241 ms
99,072 KB
testcase_24 AC 1,498 ms
103,808 KB
testcase_25 AC 192 ms
79,872 KB
testcase_26 AC 898 ms
93,056 KB
testcase_27 AC 1,746 ms
109,312 KB
testcase_28 AC 1,319 ms
101,368 KB
testcase_29 AC 624 ms
87,552 KB
testcase_30 AC 229 ms
79,880 KB
testcase_31 AC 1,480 ms
103,796 KB
testcase_32 AC 321 ms
81,152 KB
testcase_33 AC 1,350 ms
101,504 KB
testcase_34 AC 867 ms
92,160 KB
testcase_35 AC 1,606 ms
106,496 KB
testcase_36 AC 1,213 ms
77,696 KB
testcase_37 AC 1,749 ms
109,184 KB
testcase_38 AC 1,726 ms
109,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

mod=998244353

T=int(input())
for tests in range(T):
    N=int(input())
    A=[list(map(int,input().split())) for i in range(N)]

    X=0
    Y=0

    Z0=0
    Z1=0

    W0=0
    W1=0
    
    for x,y in A:
        X+=x*x+y*y
        Y+=pow(x*x+y*y,mod-2,mod)

        Z0=Z0+(x*x-y*y)*pow(x*x+y*y,mod-2,mod)
        Z1=Z1+(2*x*y)*pow(x*x+y*y,mod-2,mod)
        
        W0=W0+(x*x-y*y)*pow(x*x+y*y,mod-2,mod)
        W1=W1+(-2*x*y)*pow(x*x+y*y,mod-2,mod)

    print((X*Y-(Z0*W0-Z1*W1))%mod)
0