Method for inspecting and measuring sample and scanning electron microscope