"Examination" graph on Round1 15/06/11

Source: Internet
Author: User

Exam four questions, the first two questions poi, after two silly problem.

T1 SZP

The Byteotian CIA (BIA) employs many agents. Everyone's job is to spy on another agent.
King Byteasar needed a covert operation, so he had to pick as many trusted agents as he could. But the task is so confidential that all agents involved in the operation must be monitored at least by another non-mission agent (that is, if an agent participates in the operation, at least one of the agents who had previously monitored him was not involved). Give details of the monitoring task and ask for the maximum number of agents to be involved in the calculation.

A look at the first question, obviously ring sets of trees, that must be the tree-shaped dp+ processing special side

I just played a ring a few days ago. "Ring Set tree + Tree DP" Bzoj1040 [ZJOI2008] Knight

Then recalled, found that in fact can not be copied to deal with (the problem directly without the tree processing can be the problem must have to the tree)

Anyway really played for a long time, then various bugs, various will not be debugged with guide

Then found that if the ring only two points will be a problem, tangled for a long time QWQ

In short, think of the previous problem and think of the current chaos, and then you must not be so this state is too enchanted

Finally, the wrong thing, then 75 points

I heard someone upset the greedy 艹 out of 90? A bunch of people are 50+? We don't know about the ring bushes?

In fact, there are two kinds of positive solutions, dp/greedy.

The initial all points are white, and for point I, if a[i] is white it is dyed with a different color than I.

Proof: If point I is determined to be white, a[i] dyeing White can only provide a black spot, so a[i] dyeing black is not bad; if all points pointing to I are black, I can only be white.

Using the topology sort implementation, first the non-degree points in the queue, the last remaining ring from any place to cut.

The situation on the ring can be divided into odd, even through the discussion to get the number is right.

Directly want DP Greedy completely did not think, in fact, it seems not very difficult to think QWQ

Still can't be used to limit the QWQ

T2 Zaw

There is a cave entrance at the foot of the mountain of Byte. The cavern is made up of tunnels connected by complex chambers. The entrance to the cave is number 1th. The two chambers are either connected by a tunnel or indirectly connected through a number of tunnels. Now decided to organize a ' King's of Byteotia Cup ' contest. The goal of the contestants is to choose a path to enter the cave and get out as soon as possible. A path must pass beyond 1 to pass at least one other hole. A hole in one path cannot be repeated (except for 1), and a similar tunnel cannot be repeated. A famous cave explorer, Byteala, is preparing to take part in the competition. Byteala has been training for months and he has got a set of detailed information about the cave system. For each tunnel he calculates in detail the time required to pass from two directions. The time passed through a cavern is short and can be ignored. The Byteala now calculates an optimal path that meets the criteria.

The first line has two numbers n and m (3 <= n <=, 3 <= m <= 10000) respectively representing the number of cavities and the number of tunnels connected to them. The chambers are numbered from 1 to N. The "front hole" is numbered 1. The next M-line describes all the tunnels. Each line of four integers a,b,c,d represents a C-minute time from the Chamber A to the Cavern B, while the time from chamber B to hole a requires D minutes, 1 <= A, b <= N, a <> B, 1 <= c,d <= 10000. You can assume that the path that meets the requirements must exist.

The feeling is very strange, is to find a minimum ring.

In the examination room my idea is, does not repeat therefore for 1 certainly is one side enters one side to go out, sets this both sides is the B and the C,BC to take the shortest way, because most short circuit certainly also will not repeat.

And then sort out the 1-connected side, do single source the shortest possible.

The idea of the solution is probably the same, but just find a side and then do SPFA set to not pass, probably almost.

But I blew zero?! Results.. Output intermediate variable forgot to comment.

Another crime!

Then only 80 points, the construction data is card (1 connected to a bunch of edges) into 2s

But SPFA is not optimized to die!

But the original Question Time is clearly 10s open 1s noisy which!

T3 T4

Two Michizane silly questions.

Very uncomfortable T3 ensure that the Sigma data <longint, see this sentence directly did not think about the use of int, the result will explode int!

The question of the people add this sentence mentality! 60 off

It's sad, don't do it again, Qwq.

"Examination" graph on Round1 15/06/11

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.