結果
問題 |
No.2094 Symmetry
|
ユーザー |
👑 |
提出日時 | 2023-05-22 14:05:03 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 466 bytes |
コンパイル時間 | 399 ms |
コンパイル使用メモリ | 81,952 KB |
実行使用メモリ | 197,720 KB |
最終ジャッジ日時 | 2024-12-22 09:25:33 |
合計ジャッジ時間 | 57,234 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 TLE * 18 |
ソースコード
I=input def J(): return map(int,I().split()) def S(D): return sorted(D.items(),reverse=1) N,K=J() R=range(N*2) b=0 for i in R: for c in I():b+=c=="#" D,E={},{} for i in R: C=list(J()) for c in C: if c in D:D[c]+=1 else:D[c]=1 for i in R: c=C[i]+C[N*2-i-1] if c in E:E[c]+=i<N else:E[c]=1 F,G=S(D),S(E) s=1-b%2 m=[0]*2 for a,e,k in [b,F,0],[b//2,G,1]: while (a>0)*len(e): i,j=e.pop(0) a,m[k]=max(0,a-j),m[k]+min(a,j)*i print(max(m[0],(K+m[1])*s))