結果
問題 | No.1304 あなたは基本が何か知っていますか?私は知っています. |
ユーザー | vwxyz |
提出日時 | 2023-03-20 02:10:39 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,889 bytes |
コンパイル時間 | 561 ms |
コンパイル使用メモリ | 12,928 KB |
実行使用メモリ | 34,336 KB |
最終ジャッジ日時 | 2024-06-12 18:13:22 |
合計ジャッジ時間 | 6,629 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 405 ms
34,336 KB |
testcase_01 | AC | 1,055 ms
27,392 KB |
testcase_02 | AC | 477 ms
27,136 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
04_evil_A_01 | -- | - |
04_evil_A_02 | -- | - |
04_evil_A_03 | -- | - |
04_evil_A_04 | -- | - |
04_evil_A_05 | -- | - |
04_evil_A_06 | -- | - |
04_evil_A_07 | -- | - |
04_evil_A_08 | -- | - |
04_evil_A_09 | -- | - |
04_evil_A_10 | -- | - |
05_evil_B_01 | -- | - |
05_evil_B_02 | -- | - |
05_evil_B_03 | -- | - |
05_evil_B_04 | -- | - |
05_evil_B_05 | -- | - |
05_evil_B_06 | -- | - |
05_evil_B_07 | -- | - |
05_evil_B_08 | -- | - |
05_evil_B_09 | -- | - |
05_evil_B_10 | -- | - |
06_evil_C_01 | -- | - |
06_evil_C_02 | -- | - |
06_evil_C_03 | -- | - |
06_evil_C_04 | -- | - |
06_evil_C_05 | -- | - |
06_evil_C_06 | -- | - |
06_evil_C_07 | -- | - |
06_evil_C_08 | -- | - |
06_evil_C_09 | -- | - |
06_evil_C_10 | -- | - |
ソースコード
import sys readline=sys.stdin.readline def Hadamard(polynomial,n,mod=0,inverse=False): polynomial_=[x for x in polynomial]+[0]*((1<<n)-len(polynomial)) for bit in range(n): for i in range(1<<n): ii=i^(1<<bit) if i>ii: continue polynomial_[i],polynomial_[ii]=polynomial_[i]+polynomial_[ii],polynomial_[i]-polynomial_[ii] if mod: polynomial_[i]%=mod polynomial_[ii]%=mod if inverse: if mod: inve_2=pow((mod+1)//2,n) for i in range(1<<n): polynomial_[i]*=inve_2 polynomial_[i]%=mod else: pow_2=pow(2,n) for i in range(1<<n): polynomial_[i]/=pow_2 return polynomial_ def XOR_Convolution(polynomial0,polynomial1,mod=0): n=(max(len(polynomial0),len(polynomial1))-1).bit_length() Hadamard_polynomial0=Hadamard(polynomial0,n,mod=mod) Hadamard_polynomial1=Hadamard(polynomial1,n,mod=mod) if mod: convolution=[x*y%mod for x,y in zip(Hadamard_polynomial0,Hadamard_polynomial1)] else: convolution=[x*y for x,y in zip(Hadamard_polynomial0,Hadamard_polynomial1)] convolution=Hadamard(convolution,n,mod=mod,inverse=True) return convolution N,K,X,Y=map(int,readline().split()) Y+=1 A=list(map(int,readline().split())) mod=998244353 dp=[[0]*(1<<10) for i in range(1<<10)] for a in A: dp[a][a]=1 for n in range(1,N): prev=dp dp=[[0]*(1<<10) for i in range(1<<10)] cnt=[0]*(1<<10) for i in range(1<<10): for j in range(1<<10): cnt[j]+=prev[i][j] cnt[j]%=mod for a in A: for j in range(1<<10): dp[a][a^j]+=cnt[j]-prev[a][j] dp[a][a^j]%mod ans=0 for i in range(1<<10): for j in range(X,Y): ans+=dp[i][j] ans%=mod print(ans)