結果
問題 | No.856 増える演算 |
ユーザー | convexineq |
提出日時 | 2021-04-03 16:59:47 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,426 bytes |
コンパイル時間 | 183 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 182,456 KB |
最終ジャッジ日時 | 2024-06-07 03:53:47 |
合計ジャッジ時間 | 37,845 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 358 ms
174,088 KB |
testcase_01 | AC | 360 ms
174,292 KB |
testcase_02 | AC | 347 ms
174,100 KB |
testcase_03 | AC | 351 ms
173,876 KB |
testcase_04 | WA | - |
testcase_05 | AC | 350 ms
173,912 KB |
testcase_06 | AC | 349 ms
174,356 KB |
testcase_07 | AC | 351 ms
173,776 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 356 ms
173,852 KB |
testcase_11 | WA | - |
testcase_12 | AC | 350 ms
173,960 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 367 ms
174,048 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 367 ms
174,152 KB |
testcase_23 | AC | 374 ms
174,140 KB |
testcase_24 | AC | 382 ms
174,004 KB |
testcase_25 | AC | 376 ms
174,412 KB |
testcase_26 | WA | - |
testcase_27 | AC | 372 ms
174,052 KB |
testcase_28 | AC | 381 ms
174,056 KB |
testcase_29 | AC | 371 ms
174,056 KB |
testcase_30 | WA | - |
testcase_31 | AC | 368 ms
174,104 KB |
testcase_32 | AC | 372 ms
174,196 KB |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | AC | 383 ms
174,748 KB |
testcase_36 | AC | 391 ms
174,828 KB |
testcase_37 | WA | - |
testcase_38 | AC | 371 ms
174,028 KB |
testcase_39 | AC | 369 ms
174,304 KB |
testcase_40 | WA | - |
testcase_41 | AC | 377 ms
174,144 KB |
testcase_42 | AC | 390 ms
174,840 KB |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | AC | 382 ms
174,256 KB |
testcase_50 | WA | - |
testcase_51 | AC | 395 ms
174,584 KB |
testcase_52 | AC | 398 ms
174,604 KB |
testcase_53 | WA | - |
testcase_54 | WA | - |
testcase_55 | AC | 483 ms
175,716 KB |
testcase_56 | WA | - |
testcase_57 | AC | 496 ms
175,292 KB |
testcase_58 | AC | 475 ms
175,212 KB |
testcase_59 | AC | 550 ms
182,348 KB |
testcase_60 | AC | 457 ms
174,904 KB |
testcase_61 | AC | 557 ms
182,456 KB |
testcase_62 | WA | - |
testcase_63 | AC | 390 ms
174,024 KB |
testcase_64 | AC | 527 ms
181,912 KB |
testcase_65 | WA | - |
testcase_66 | AC | 456 ms
174,904 KB |
testcase_67 | WA | - |
testcase_68 | AC | 531 ms
181,884 KB |
testcase_69 | AC | 527 ms
182,332 KB |
testcase_70 | WA | - |
testcase_71 | AC | 542 ms
182,336 KB |
testcase_72 | WA | - |
testcase_73 | AC | 566 ms
181,464 KB |
testcase_74 | WA | - |
testcase_75 | WA | - |
testcase_76 | WA | - |
testcase_77 | WA | - |
testcase_78 | WA | - |
testcase_79 | AC | 563 ms
181,660 KB |
testcase_80 | AC | 565 ms
181,456 KB |
testcase_81 | AC | 561 ms
181,452 KB |
testcase_82 | AC | 476 ms
179,552 KB |
ソースコード
from math import pi,cos,sin,log ROOT = 3 roots = [cos(2*pi/2**i) + sin(2*pi/2**i)*1j for i in range(24)] iroots = [cos(2*pi/2**i) - sin(2*pi/2**i)*1j for i in range(24)] def untt(a,n): for i in range(n): m = 1<<(n-i-1) for s in range(1<<i): w_N = 1 s *= m*2 for p in range(m): a[s+p], a[s+p+m] = (a[s+p]+a[s+p+m]), (a[s+p]-a[s+p+m])*w_N w_N *= roots[n-i] def iuntt(a,n): for i in range(n): m = 1<<i for s in range(1<<(n-i-1)): w_N = 1 s *= m*2 for p in range(m): a[s+p], a[s+p+m] = (a[s+p]+a[s+p+m]*w_N)/2, (a[s+p]-a[s+p+m]*w_N)/2 w_N *= iroots[i+1] def pow2(a): deg = 2*len(a)-2 n = deg.bit_length() N = 1<<n a += [0.0]*(N-len(a)) untt(a,n) for i in range(N): a[i] *= a[i] iuntt(a,n) return a[:deg+1] n = int(input()) *a, = map(int,input().split()) V = [0.0j]*(10**5+1) for ai in a: V[ai] += 1 V = pow2(V) for ai in a: V[2*ai] -= 1 MOD = 10**9+7 ans = 1 for i,vi in enumerate(V): ans = ans*pow(i,int(round(vi.real))//2,MOD)%MOD v = 0 for ai in a[::-1]: ans = ans*pow(ai,v,MOD)%MOD v += ai L,R,r,v = 0,a[n-1],a[n-1],1e9 for ai in a[n-2::-1]: w = R*log(ai) + log(ai+R) if w < v: L,R,v = ai,r,w r = min(r,ai) v = (L+R)*pow(L,R,MOD)%MOD print(ans*pow(v,MOD-2,MOD)%MOD)