Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1450 | Codeforces Global Round 12 | FINISHED | False | 10800 | 124557899 | Dec. 6, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1151 ) | E | Capitalism | PROGRAMMING | constructive algorithms dfs and similar graphs shortest paths |
B'A society can be represented by a connected, undirected graph of n vertices and m edges. The vertices represent people, and an edge (i,j) represents a friendship between people i and j . In society, the i -th person has an income a_i . A person i is envious of person j if a_j=a_i+1 . That is if person j has exactly 1 more unit of income than person i . The society is called capitalist if for every pair of friends one is envious of the other. For some friendships, you know which friend is envious of the other. For the remaining friendships, you do not know the direction of envy. The income inequality of society is defined as max limits_{1 <= q i <= q n} a_i - min limits_{1 <= q i <= q n} a_i . You only know the friendships and not the incomes. If it is impossible for this society to be capitalist with the given knowledge, you should report about it. Otherwise, you should find an assignment of incomes in which the society is capitalist, and the income inequality is maximized. The first line contains two integers n , m ( 1 <= n <= 200 , n-1 <= m <= 2000 ) -- the number of people and friendships, respectively. The following m lines describe the friendships. Each friendship is described by three integers i , j , b ( 1 <= i, j <= n, i ne j, 0 <= b <= 1 ). This denotes that people i and j are friends. If b=1 , we require that person i is envious of person j . If b=0 , one friend should be envious of the other in either direction. There is at most one friendship between each pair of people. It is guaranteed that if we consider the friendships as undirected edges, the graph is connected. Print "YES" if it is possible that the society is capitalist, or "NO" otherwise. You can print characters in any case (upper or lower). If the answer is "YES", you should print two additional lines. In the first line, print '... |
Codeforces Global Round 12 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
100597834 | Fuyuki | E | Dec. 7, 2020, 3:49 a.m. | OK | GNU C++11 | TESTS | 77 | 31 | 204800 | ||
100596904 | 2016wudi | E | Dec. 7, 2020, 3:16 a.m. | OK | GNU C++11 | TESTS | 77 | 46 | 0 | ||
100599865 | tzaph_ | E | Dec. 7, 2020, 4:46 a.m. | OK | GNU C++11 | TESTS | 77 | 46 | 102400 | ||
100597807 | haitian | E | Dec. 7, 2020, 3:48 a.m. | OK | GNU C++11 | TESTS | 77 | 46 | 102400 | ||
100583138 | shenxy13 | E | Dec. 6, 2020, 6:33 p.m. | OK | GNU C++11 | TESTS | 77 | 46 | 204800 | ||
100589173 | Jonathan1234 | E | Dec. 6, 2020, 8:48 p.m. | OK | GNU C++11 | TESTS | 77 | 46 | 512000 | ||
100589100 | Jonathan1234 | E | Dec. 6, 2020, 8:45 p.m. | OK | GNU C++11 | TESTS | 77 | 46 | 512000 | ||
100575350 | Evolylenol | E | Dec. 6, 2020, 5:06 p.m. | OK | GNU C++11 | TESTS | 77 | 46 | 819200 | ||
100582956 | 201831990439 | E | Dec. 6, 2020, 6:31 p.m. | OK | GNU C++11 | TESTS | 77 | 46 | 24678400 | ||
100590641 | lrvideckis | E | Dec. 6, 2020, 9:42 p.m. | OK | GNU C++11 | TESTS | 77 | 62 | 614400 | ||
100584909 | Strikeskids | E | Dec. 6, 2020, 6:59 p.m. | OK | GNU C++14 | TESTS | 77 | 31 | 307200 | ||
100575775 | Noam527 | E | Dec. 6, 2020, 5:09 p.m. | OK | GNU C++14 | TESTS | 77 | 31 | 307200 | ||
100566654 | ugly2333 | E | Dec. 6, 2020, 4:20 p.m. | OK | GNU C++14 | TESTS | 77 | 31 | 20377600 | ||
100586768 | MrMiroticc | E | Dec. 6, 2020, 7:37 p.m. | OK | GNU C++14 | TESTS | 77 | 46 | 307200 | ||
100583638 | BSBandme | E | Dec. 6, 2020, 6:39 p.m. | OK | GNU C++14 | TESTS | 77 | 46 | 307200 | ||
100586030 | qxforever | E | Dec. 6, 2020, 7:19 p.m. | OK | GNU C++14 | TESTS | 77 | 46 | 409600 | ||
100585001 | pikmike | E | Dec. 6, 2020, 7:01 p.m. | OK | GNU C++14 | TESTS | 77 | 46 | 409600 | ||
100584695 | Potassium | E | Dec. 6, 2020, 6:55 p.m. | OK | GNU C++14 | TESTS | 77 | 46 | 409600 | ||
100597491 | marcOS | E | Dec. 7, 2020, 3:36 a.m. | OK | GNU C++14 | TESTS | 77 | 46 | 614400 | ||
100570214 | al3xstr33t | E | Dec. 6, 2020, 4:38 p.m. | OK | GNU C++14 | TESTS | 77 | 46 | 4403200 | ||
100601357 | Shironagi | E | Dec. 7, 2020, 5:22 a.m. | OK | GNU C++17 | TESTS | 77 | 31 | 204800 | ||
100587789 | Doniil | E | Dec. 6, 2020, 8:06 p.m. | OK | GNU C++17 | TESTS | 77 | 31 | 204800 | ||
100584633 | Shayan.P | E | Dec. 6, 2020, 6:54 p.m. | OK | GNU C++17 | TESTS | 77 | 31 | 204800 | ||
100579038 | ShadowLight | E | Dec. 6, 2020, 5:26 p.m. | OK | GNU C++17 | TESTS | 77 | 31 | 204800 | ||
100570522 | 6aren | E | Dec. 6, 2020, 4:40 p.m. | OK | GNU C++17 | TESTS | 77 | 31 | 204800 | ||
100597826 | mr.brown | E | Dec. 7, 2020, 3:48 a.m. | OK | GNU C++17 | TESTS | 77 | 31 | 307200 | ||
100580524 | hank55663 | E | Dec. 6, 2020, 5:33 p.m. | OK | GNU C++17 | TESTS | 77 | 31 | 307200 | ||
100576056 | geniosity | E | Dec. 6, 2020, 5:10 p.m. | OK | GNU C++17 | TESTS | 77 | 31 | 307200 | ||
100593413 | YaoBIG | E | Dec. 7, 2020, 12:29 a.m. | OK | GNU C++17 | TESTS | 77 | 31 | 409600 | ||
100580254 | SHZhang2 | E | Dec. 6, 2020, 5:32 p.m. | OK | GNU C++17 | TESTS | 77 | 31 | 409600 | ||
100571557 | saketh | E | Dec. 6, 2020, 4:45 p.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 0 | ||
100582739 | Marckess | E | Dec. 6, 2020, 6:28 p.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 102400 | ||
100579439 | FlowerOfSorrow | E | Dec. 6, 2020, 5:28 p.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 102400 | ||
100567025 | olphe | E | Dec. 6, 2020, 4:22 p.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 102400 | ||
100599138 | errorgorn | E | Dec. 7, 2020, 4:27 a.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 204800 | ||
100597206 | RiverHamster | E | Dec. 7, 2020, 3:26 a.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 204800 | ||
100591570 | tfg | E | Dec. 6, 2020, 10:26 p.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 204800 | ||
100591174 | Monogon | E | Dec. 6, 2020, 10:08 p.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 204800 | ||
100582867 | YouKn0wWho | E | Dec. 6, 2020, 6:30 p.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 204800 | ||
100572429 | Anachor | E | Dec. 6, 2020, 4:50 p.m. | OK | GNU C++17 (64) | TESTS | 77 | 31 | 204800 | ||
100573665 | mikit | E | Dec. 6, 2020, 4:57 p.m. | OK | Java 11 | TESTS | 77 | 217 | 0 | ||
100573729 | uwi | E | Dec. 6, 2020, 4:57 p.m. | OK | Java 11 | TESTS | 77 | 732 | 0 | ||
100574293 | gnomina007 | E | Dec. 6, 2020, 5 p.m. | OK | MS C++ 2017 | TESTS | 77 | 46 | 1945600 | ||
100566557 | ngtkana | E | Dec. 6, 2020, 4:20 p.m. | OK | Rust | TESTS | 77 | 77 | 409600 |
Back to search problems