Nonvolatile logic and ternary content-addressable memory based on complementary black phosphorus and rhenium disulfide Transistors