A search for supersymmetry involving the pair production of gluinos decaying via third-generation squarks to the lightest neutralino (χ 0 1 ) is reported. It uses an LHC proton-proton data set at a center-of-mass energy ffiffi ffi s p ¼ 13 TeV with an integrated luminosity of 3.2 fb −1 collected with the ATLAS detector in 2015.The signal is searched for in events containing several energetic jets, of which at least three must be identified as b jets, large missing transverse momentum, and, potentially, isolated electrons or muons. Large-radius jets with a high mass are also used to identify highly boosted top quarks. No excess is found above the predicted background. Forχ 0 1 masses below approximately 700 GeV, gluino masses of less than 1.78 TeV and 1.76 TeV are excluded at the 95% C.L. in simplified models of the pair production of gluinos decaying via sbottom and stop, respectively. These results significantly extend the exclusion limits obtained with the ffiffi ffi s p ¼ 8 TeV data set.