If the importance of a bilateral relationship is judged by the time spent talking, then write off Nicaragua and chalk tonight up to the People's Republic of China.

Premier Zhao Ziyang spent 4 1/2 minutes talking to President Reagan at the reception Reagan hosted for world leaders attending the 40th anniversary commemoration of the United Nations. Nicaragua's President Daniel Ortega got less than a minute.

If, on the other hand, the importance of a bilateral relationship is judged by how readily the host bends his own rules of protocol, then the Soviet Union was clearly the winner.

Soviet Foreign Minister Eduard Shevardnadze was the only foreign minister at the Waldorf Astoria party who did not accompany his chief of state or head of government. What makes that significant is that the White House itself drew up the rules on who to invite to the party. The way it went was that foreign ministers were only invited if their heads of state or governments accepted.

"There are lots of rules of protocol all warehoused on the shelf. You take off the shelf the one you need for the occasion," said a U.S. official who asked not to be identified. "But if we're going to break the rule for any reason, I think the reasons of national security, arms control and peace are as good as any."

The Reagan administration not only broke its own rule about guests but sent a helicopter out to the airport to pick up Shevardnadze, another sign of the importance being placed on preparations for next month's summit in Geneva. He flew to New York from Belgrade, where he was attending a meeting of Warsaw Pact countries.

The Soviet official arrived at the party with his wife, who was wearing a black velveteen dress, and Soviet Ambassador Anatoliy Dobrynin. Hustled to the front of the line, Shevardnadze shook hands with Reagan and spent at least 15 seconds in conversation. Then he moved on to shake hands with First Lady Nancy Reagan, who was wearing a dark green, blue and white cocktail dress with a large rhinestone belt buckle and a diamond necklace with matching earrings, and Secretary of State George Shultz.

When Reagan spotted Dobrynin, he said, "Hi, how are you?" and winked.

It was later, when the receiving line ended and the Reagans started to circulate, that he and Ziyang had their little talk. Interpreters made sure there were no misunderstandings, and Shultz stood by discreetly.

Meanwhile, across the chandeliered Empire Room, where piano music punctuated the conversation, Shevardnadze was being kept in what appeared to be a holding position by White House chief of staff Donald Regan and national security adviser Robert McFarlane. Behind them Nancy Reagan was talking to Imelda Marcos of the Philippines, whose husband did not come to New York.

Even after Ziyang and Reagan's conversation came to an end, the president still remained some distance from his Soviet guest. President Abdou Diouf of Senegal, head of the Organization of African Unity, struck up a conversation with Reagan, and for a while it looked as if it was going to rival in length the one with Ziyang.

Politicians being politicians whatever their nationality, the talk went nonstop. After Diouf there was Luxembourg's Prime Minister Jacques Santer, followed by West Germany's Helmut Kohl. He was almost run down earlier in the day by Reagan's motorcade as he stood talking to reporters outside the U.N. building. If appearances count for anything, he seemed not to hold that against his host tonight.

Finally, the big moment arrived and Reagan and Shevardnadze, both in business suits, came together. White House spokesman Larry Speakes later described the conversation. He said the president and foreign minister agreed to meet Thursday for 30 minutes at the Waldorf. The idea for the meeting was "mutual."

Referring to the letter delivered by Shevardnadze during the recent White House meeting, the president reportedly said, "I appreciate the letter from Secretary Mikhail Gorbachev. We are studying the proposals."

"Everyone is awaiting your meeting with Gorbachev ," the Soviet official told Reagan, adding, "I'm looking forward to meeting with Secretary Shultz." Shevardnadze and Shultz are scheduled to meet here Friday.

Elsewhere among the 61 heads of state or government milling around the room, Ortega and his wife were talking with New York Mayor Ed Koch. Rosaria Murillo, as Ortega's wife is called, was chic in a satiny blue and red print dress.

Later, Koch told reporters that he and Ortega first met five years ago, when the Nicaraguan leader was wearing his military uniform everywhere he went.

"I said you look better in civilian clothes, you look more peaceful," said Koch, who described himself as having "led the fight" to cut aid to Nicaragua when Anastasio Somoza was in power.

"They're engaging people," Koch continued. "Most of the countries that politically we disagree with -- the Soviet Union, the Arab states, Third World juntas -- those people who represent these countries are charming. Ortega in personal conversations is a charming man, totally different than when making martial speeches at the U.N. or elsewhere."

Many guests were wearing colorful and elaborate native dress. None seemed very thirsty or hungry, even though the White House and the State Department had spared no expense to wine and dine them. White House social secretary Linda Faulkner has been here since Saturday overseeing arrangements for the party.

The lavish menu included rack of lamb Florentine; lobster, shrimp and scallops in basil sauce; gravelox (cured salmon) with fennel and dill; angel hair pasta with fresh white truffles; cre pes made on the spot and filled with peaches and wild strawberries; fresh tuna with pickled ginger; dill and butter on a shish kebab; and crabmeat puffs filled with zucchini and scalloped mousse.

Outside, on Park Avenue and surrounding streets, limousines and New York Police Department cars were three and four deep. Security was a nightmare for ordinary citizens just passing by or trying to get back to their hotel rooms.

But apparently security was nothing like the good old bad days, if one could believe a group of U.S. Secret Service agents riding up a Waldorf Astoria elevator.

"Remember those cards we used to have that said: 'I seize this conveyance in the name of the United States government?' " one agent asked.

"I sure do," replied another. "And I used to seize everything I came in contact with."