For Virginia, as the basketball gets better the losses become more frustrating.

Tonight, the Cavaliers led 15th-ranked North Carolina for almost the entire first half. They put together a 17-3 run during the last five minutes of the game, the kind that usually produces a victory.

But when the entire 40 minutes were over, Carolina had an 82-73 victory and the Cavaliers had another long, dark plane ride home to look forward to. "For 20 minutes, it seems like we can play with anybody," said Virginia point guard Tom Calloway. "But those lapses kill us."

The lapses, like a 17-minute stretch tonight when they were outscored, 46-22, are the reason the Cavaliers are now 1-8 in ACC play and 11-11 in all games. Tonight's beneficiary, Carolina, broke a three-game conference losing streak and moved into third place (behind Maryland and Georgia Tech) in the ACC with a 5-3 record, 17-5 overall.

"Strange game," Carolina's Buzz Peterson admitted. "But it was a victory and we had to have one."

The same could be said for Virginia. This game wasn't so much one game as three. During the first, Virginia methodically attacked Carolina's defense, got some solid shooting from Mel Kennedy (14 points) and Olden Polynice (14 points) and took a 32-24 lead with three minutes left in the first half.

During the second game, the Tar Heels, who got 18 points from backup center Warren Martin, 17 from point guard Kenny Smith and 11 points and as many rebounds from Brad Daugherty in the contest, took complete command.

They ended the half with a 10-2 streak that produced a 34-34 halftime tie, then burst out of the blocks in the second half by hitting their first nine shots. In the meantime, the Cavaliers, who finished the game hitting just 33 of 73 shots, put up enough bricks to complete the new gym Carolina is building and found themselves trailing, 70-54, with 5:23 left.

And, finally, there was the third game, during which Virginia, a team that can't pressure the ball, practically pressured Carolina into a stunning collapse. With Calloway leading the way, the Cavaliers produced a 17-3 streak in less than four minutes, cutting the lead to 73-71 with 1:30 to go as the Tar Heels did a Keystone Kops routine before 10,000 amazed fans in Carmichael Auditorium.

"We played very well for the first 15 minutes of the second half," North Carolina Coach Dean Smith said. "Then, when they went to the press, we bent, but we didn't break."

Barely. After a 20-footer by Darrick Simms with 1:30 left had cut the margin to two, Carolina went to its spread with Kenny Smith running the middle. "At that point, we had been going so hard, trapping and pressing for so long, that we couldn't adjust to playing a little softer," Virginia Coach Terry Holland said. "We committed a foul we didn't want to commit."

It happened when Calloway and Simms tried to trap Kenny Smith. They didn't get the ball, but Simms was called for a block. That put Smith on the line.

"The important thing was that we didn't panic," Smith said. "We knew we had the ball and the lead. They were going to have to stop us and then come down and hit a shot just to get even. We kept cool and did what we had to."

Specifically, Smith did what he had to. He stepped to the line with 1:17 left and, with the building nervously silent, made both shots for a 75-71 lead. Eleven seconds later, Kennedy missed a short base-line jumper and when Martin, fouled on the rebound, hit two free throws to make it 77-71 with 1:06 left, the rally was over.

"When they made the run," Dean Smith said, "I was thinking a little of '81, but more of last year."

Last year, Carolina blew all but two points of a 21-point lead here against the Cavaliers, even allowing them a shot to tie in the final minute. In 1981, U.-Va. overcame a 16-point lead in the last four minutes to win in overtime. In the two years in between, 1982 and 1983, Carolina came from way behind to win.

In short, when these two teams play in this building, strange things happen to big leads. "When we got the lead down to two, I thought we were going to win," said Kennedy. "But we made a dumb foul (on Smith) and that took our momentum away. And that gave them that little boost they needed to get by us."

Or, as Holland put it, "There were a couple of stretches where we just couldn't put the ball in the basket, and that's what killed us."

More than anything, that's what has killed Virginia all season. Tonight, Tom Sheehey shot four for 16, Jim Miller four of 10 and Tim Mullen one of five. Along with Polynice, they are the team's most experienced players.

"They're a very good basketball team; much better than their record reflects," Dean Smith said in an attempt to be gracious.

Unfortunately, the Cavaliers probably aren't much better than their record reflects. They play hard and, as Smith put it, "they never die." But merely playing hard is not enough in the ACC.

A team must shoot the ball, rebound it and keep it from going inside when the other team has it. Virginia has trouble with all three of those things. That is why, in spite of efforts like this, it is sitting firmly in last place in the ACC.