結果
問題 | No.2344 (l+r)^2 |
ユーザー | prussian_coder |
提出日時 | 2023-06-11 08:45:46 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 525 bytes |
コンパイル時間 | 277 ms |
コンパイル使用メモリ | 87,252 KB |
実行使用メモリ | 100,656 KB |
最終ジャッジ日時 | 2023-08-31 01:50:32 |
合計ジャッジ時間 | 4,488 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 71 ms
71,088 KB |
testcase_01 | AC | 627 ms
78,980 KB |
testcase_02 | AC | 272 ms
79,828 KB |
testcase_03 | AC | 271 ms
78,660 KB |
testcase_04 | AC | 290 ms
84,292 KB |
testcase_05 | AC | 272 ms
79,312 KB |
testcase_06 | AC | 269 ms
79,744 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
ソースコード
T=int(input()) def rep_mul(a,x,m): t=0 val=a while t<x: if val==0 or val==1: return val val*=a val%=m t+=1 return val def process(A,m): N=len(A) if N==1: return A[0] B=[(A[i]+A[i+1])**2%m for i in range(N-1)] return process(B,m) def solve(): L,M=map(int,input().split()) A=[int(x) for x in input().split()] m=1<<M D=100 if L>D: if L%2==0: X=L-D else: X=L-D-1 A=[rep_mul(A[i],X,m)+rep_mul(A[i+X],X,m) for i in range(L-X)] print(A) print(process(A,m)) for _ in range(T): solve()