According to one embodiment, a sensor includes a deformable film portion, a first sensing element and a second sensing element. The first sensing element is fixed to the film portion, and includes a first magnetic layer of a first material, a first opposing magnetic layer, and a first intermediate layer. The first intermediate layer is provided between the first magnetic layer and the first opposing magnetic layer. The second sensing element is fixed to the film portion, and includes a second magnetic layer of a second material, a second opposing magnetic layer, and a second intermediate layer. The second material is different from the first material. The second intermediate layer is provided between the second magnetic layer and the second opposing magnetic layer.