Sitting cross-legged on the hallway’s blue tile, three Prince William County teenagers looked vexed as they considered what appeared to be a miniature version of an oil rig.

The object of their scrutiny was an underwater robot vessel, and at stake for the Patriot High School students were the fruits of more than 100 hours of work and, perhaps, a trophy. Round One at Thursday’s National SeaPerch Challenge at the Manassas Park Community Center pool didn’t go so well for the trio. They were looking for solutions outside the pool area.

Inside the pool area was a day-long cacophony. Robots moved through the water to overcome a variety of challenges as judges with clipboards stood nearby. There was an obstacle course with rings at the bottom of the pool. There was a deep-sea salvage mission, essentially a paint bucket with holes in the bottom that robots were required to bring to the surface. And there was a presentation round, in which students explained the scientific and engineering concepts behind their vessels.

Seventy high school and middle school teams from across the country competed in various categories, including five from the District, 10 from Virginia and 18 from Maryland.

Ultimately, while the chlorine-filled air at the pool resonated with yells of encouragement from proud parents and anxious coaches, the competition was mostly about spurring the study of science, technology, engineering and mathematics, often known as the STEM fields, and was funded by the Office of Naval Research. The Navy hopes to promote interest in those subjects and point students to future careers.

Misho Ahmed, 17, who started a robotics club at Gar-Field High School in Prince William, explained the attraction. “In school, you’re going to get tired of anything,” he said. “You might as well get tired of something you like.”

For the trio from Patriot High — Ben Johnson, 14, Harmit Singh, 14, and Ben Kolding, 15 — the salvage mission proved the trickiest. They asked for another shot.

The team had come up with a design that drew notice from competitors: A can of compressed air, like the kind that blows dust off a computer keyboard, was strapped into place with electrical tape and rubber bands. A string was pulled to release the air, which inflated a bag that provided lift for the robot.

But the team encountered a problem when they tried to pry the bucket loose for the salvage mission — the string that blew out the air broke. Then the bag came off.

Singh started experimenting with a Wal-Mart bag he found nearby.

The team redistributed weight while Singh attached the bag as compressed air filled it up.

“It could be perfect,” Singh said. From that point, they had 35 minutes left to make the fix. They marked the time on an iPhone.

Kevin Johnson, a teacher at one of the Dorothy I. Height Community Academy Public Charter Schools in the District, watched his eighth-graders.

“I’m a nervous wreck,” he said as his students navigated the salvage bucket course. They had arrived at 6:30 a.m. and were expecting to stay past 8 p.m. It was the school’s first year in the competition. Johnson was anxious about the students’ state of mind as they maneuvered to get their vessel under a bucket and break it free. He didn’t want them to get discouraged. The school doesn’t have access to a pool, so this was the team’s first real underwater test.

But he didn’t want to use that as a reason not to do something. “There should be no excuse,” he said. “They should have every opportunity possible.”

Afterward, with no buckets floating to the surface, Jhane Taylor, 14, didn’t seem down.

“It’s our first time,” she said. “It’s competitive . . . [but it’s] uplifting.”

The three Patriot High students were back at poolside. They made some adjustments, redistributing weight. They also bought an inflatable “floatie” (the kind little kids strap around their arms in a pool) to attach to the air compressor.

Navy Cmdr. Dan Rochford, a judge, saw the design. “You know that’s how we lift ships off the bottom of the ocean, right?” he told them.

In fact, the students had no idea. “History repeated itself, right there,” Rochford said.

The students had more pressing matters at that moment. “Whenever you’re ready,” the judge said.

After the vessel squirmed and danced around the bucket, its “arms” managed to get underneath. Singh, who was at the controls, groaned. The contraption got the bucket loose from the clasp. Then it was a game of oh-so-close. The floatie fell off at one point. The bucket scraped the pool wall and could not be dislodged.

“Time!” the judge said.

Singh smiled. “Can I just try getting it?”

Without waiting for an answer, he kept trying. The bucket reached the surface.

“It worked,” he said. “We just didn’t get it done in time.”