The present invention provides polycyclic compounds as IDO inhibitors and/or dual inhibitors of IDO-HDAC. Specifically, the present invention provides compounds represented by the following formula (I), wherein each group is defined as described in the specification. The compounds have IDO inhibitory activity or IDO-HDAC dual inhibitory activity and can be used for preventing or treating diseases associated with IDO and/or IDO-HDAC activity or expression levels. At the same time, the compounds of the present invention can be combined with an antitumor antibody such as PD-1 and PD-L1, and such a combination can greatly increase the antitumor response rate of the antibody and broaden the types of tumors to be treated.