  Measurements of the microlensing optical depth and event rate toward the
Large Magellanic Cloud (LMC) can be used to probe the distribution and mass
function of compact objects in the direction toward that galaxy - in the Milky
Way disk, the Milky Way dark matter halo, and the LMC itself. The previous
measurements, based on small statistical samples of events, found that the
optical depth is an order of magnitude smaller than that expected from the
entire dark matter halo in the form of compact objects. However, these previous
studies were not sensitive to long-duration events with Einstein timescales
longer than 2.5-3 yr, which are expected from massive ($10-100\,M_{\odot}$) and
intermediate-mass ($10^2-10^5\,M_{\odot}$) black holes. Such events would have
been missed by the previous studies and would not have been taken into account
in calculations of the optical depth. Here, we present the analysis of nearly
20-year-long photometric monitoring of 78.7 million stars in the LMC by the
Optical Gravitational Lensing Experiment (OGLE) from 2001 through 2020. We
describe the observing setup, the construction of the 20-year OGLE dataset, the
methods used for searching for microlensing events in the light-curve data, and
the calculation of the event detection efficiency. In total, we find 16
microlensing events (thirteen using an automated pipeline and three with manual
searches), all of which have timescales shorter than 1 yr. We use a sample of
thirteen events to measure the microlensing optical depth toward the LMC
$\tau=(0.121 \pm 0.037)\times 10^{-7}$ and the event rate $\Gamma=(0.74 \pm
0.25)\times 10^{-7}\,\mathrm{yr}^{-1}\,\mathrm{star}^{-1}$. These numbers are
consistent with lensing by stars in the Milky Way disk and the LMC itself, and
they demonstrate that massive and intermediate-mass black holes cannot comprise
a significant fraction of the dark matter.
