4

Found problem through gym contest: original contest reference?

 1 year ago
source link: http://codeforces.com/blog/entry/109052
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

By suraniadi, history, 74 minutes ago,

Relatively classic problem:

You are given a graph on n vertices labeled from 1 through n, with m undirected edges. Two vertices u and v are called neighbors if there exists an edge connecting them.

Your task is to assign each vertex a positive integer value such that for all , the value of the ith vertex is strictly smaller than the sum of the values of its neighbors. If there does not exist such an assignment, then please report so.

and the output assignment .

1 2
2 3
3 4
4 2

Answer: 1 20 10 10


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK