A semiconductor device, comprising: a substrate comprising: a first active region elongated in a horizontal direction when the semiconductor device is viewed in a top view; and a second active region elongated in the horizontal direction; an isolation structure disposed between the first active region and the second active region; a first gate structure elongated in a vertical direction when the semiconductor device is viewed in a top view and disposed on the first active region, the second active region, and the isolation structure, wherein the vertical direction is orthogonal to the horizontal direction; a second gate structure elongated in the vertical direction and disposed on the first active region, the second active region, and the isolation structure; a first slot contact structure elongated in the vertical direction and disposed between the first gate structure and the second gate structure in the horizontal direction, wherein the first slot contact structure is disposed on the first active region, the second active region, and the isolation structure; a first gate contact structure disposed on and electrically connected with the first gate structure; and a second gate contact structure disposed on and electrically connected with the second gate structure, wherein the first gate contact structure and the second gate contact structure are disposed at two opposite sides of the first slot contact structure in the horizontal direction respectively, and the first gate contact structure and the second gate contact structure are disposed between the first active region and the second active region in the vertical direction, wherein a length of the first gate contact structure in the vertical direction and a length of the second gate contact structure in the vertical direction are less than a length of the isolation structure in the vertical direction, characterized in that the first gate structure disposed on the first active region and the second gate structure disposed on the first active region are a gate electrode of a first transistor, the first gate structure disposed on the second active region and the second gate structure disposed on the second active region are a gate electrode of a second transistor, and the gate electrode of the first transistor is electrically connected with the gate electrode of the second transistor. a first active region elongated in a horizontal direction when the semiconductor device is viewed in a top view; and a second active region elongated in the horizontal direction; an isolation structure disposed between the first active region and the second active region; a first gate structure elongated in a vertical direction when the semiconductor device is viewed in a top view and disposed on the first active region, the second active region, and the isolation structure, wherein the vertical direction is orthogonal to the horizontal direction; a second gate structure elongated in the vertical direction and disposed on the first active region, the second active region, and the isolation structure; a first slot contact structure elongated in the vertical direction and disposed between the first gate structure and the second gate structure in the horizontal direction, wherein the first slot contact structure is disposed on the first active region, the second active region, and the isolation structure; a first gate contact structure disposed on and electrically connected with the first gate structure; and a second gate contact structure disposed on and electrically connected with the second gate structure, wherein the first gate contact structure and the second gate contact structure are disposed at two opposite sides of the first slot contact structure in the horizontal direction respectively, and the first gate contact structure and the second gate contact structure are disposed between the first active region and the second active region in the vertical direction, wherein a length of the first gate contact structure in the vertical direction and a length of the second gate contact structure in the vertical direction are less than a length of the isolation structure in the vertical direction,