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 |
|---|---|---|---|---|---|---|
| 843 | AIM Tech Round 4 (Div. 1) | FINISHED | False | 9000 | 272813123 | Aug. 24, 2017, 4:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 472 ) | E | Maximum Flow | PROGRAMMING | flows graphs | 2900 |
You are given a directed graph, consisting of n vertices and m edges. The vertices s and t are marked as source and sink correspondingly. Additionally, there are no edges ending at s and there are no edges beginning in t . The graph was constructed in a following way: initially each edge had capacity c i > 0 . A maximum flow with source at s and sink at t was constructed in this flow network. Let's denote f i as the value of flow passing through edge with index i . Next, all capacities c i and flow value f i were erased. Instead, indicators g i were written on edges — if flow value passing through edge i was positive, i.e. 1 if f i > 0 and 0 otherwise. Using the graph and values g i , find out what is the minimum possible number of edges in the initial flow network that could be saturated (the passing flow is equal to capacity, i.e. f i = c i ). Also construct the corresponding flow network with maximum flow in it. A flow in directed graph is described by flow values f i on each of the edges so that the following conditions are satisfied: for each vertex, except source and sink, total incoming flow and total outcoming flow are equal, for each edge 0 ≤ f i ≤ c i A flow is maximum if the difference between the sum of flow values on edges from the source, and the sum of flow values on edges to the source (there are no such in this problem), is maximum possible. The first line of input data contains four positive integers n , m , s , t ( 2 ≤ n ≤ 100 , 1 ≤ m ≤ 1000 , 1 ≤ s , t ≤ n , s ≠ t ) — the number of vertices, the number of edges, index of source vertex and index of sink vertex correspondingly. Each of next m lines of input data contain non-negative integers u i , v i , g i ( 1 ≤ u i , v i ≤ n , ) — the beginning of edge i , the end of edge i and indicator, which equals to 1 if flow value passing through edge i was positive and 0 if not. It's guaranteed that no edge connects vertex with itself. Also it's guaranteed that there are no more than one edge bet |
| AIM Tech Round 4 -- Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 29762499 | yosupo | E | Aug. 24, 2017, 10 p.m. | OK | D | TESTS | 137 | 31 | 4198400 | 2900 | |
| 29942471 | vjudge4 | E | Aug. 31, 2017, 1:04 p.m. | OK | GNU C++ | TESTS | 137 | 15 | 307200 | 2900 | |
| 29942277 | HenryPigLi | E | Aug. 31, 2017, 12:53 p.m. | OK | GNU C++ | TESTS | 137 | 15 | 307200 | 2900 | |
| 29912261 | F.Darcy | E | Aug. 30, 2017, 8:47 a.m. | OK | GNU C++ | TESTS | 137 | 15 | 16384000 | 2900 | |
| 36890672 | zhan8855 | E | April 3, 2018, 12:34 a.m. | OK | GNU C++ | TESTS | 137 | 30 | 3379200 | 2900 | |
| 40739716 | zhouyuyang | E | July 25, 2018, 11:44 a.m. | OK | GNU C++ | TESTS | 137 | 31 | 102400 | 2900 | |
| 29754090 | Haghani | E | Aug. 24, 2017, 6:18 p.m. | OK | GNU C++ | TESTS | 137 | 31 | 102400 | 2900 | |
| 29945719 | vjudge5 | E | Aug. 31, 2017, 1:19 p.m. | OK | GNU C++ | TESTS | 137 | 31 | 307200 | 2900 | |
| 29749250 | DEGwer | E | Aug. 24, 2017, 5:41 p.m. | OK | GNU C++ | TESTS | 137 | 31 | 512000 | 2900 | |
| 30266740 | shanquan2 | E | Sept. 11, 2017, 1:35 p.m. | OK | GNU C++ | TESTS | 137 | 46 | 204800 | 2900 | |
| 30193809 | King_George | E | Sept. 8, 2017, 2:51 a.m. | OK | GNU C++11 | TESTS | 137 | 15 | 0 | 2900 | |
| 29781472 | LHiC | E | Aug. 25, 2017, 1:20 p.m. | OK | GNU C++11 | TESTS | 137 | 15 | 614400 | 2900 | |
| 30299169 | ericxu0 | E | Sept. 13, 2017, 4:54 a.m. | OK | GNU C++11 | TESTS | 137 | 30 | 307200 | 2900 | |
| 29769625 | dacin21 | E | Aug. 25, 2017, 5:53 a.m. | OK | GNU C++11 | TESTS | 137 | 30 | 512000 | 2900 | |
| 29757825 | TimonKnigge | E | Aug. 24, 2017, 6:49 p.m. | OK | GNU C++11 | TESTS | 137 | 30 | 614400 | 2900 | |
| 30120679 | MohanLau | E | Sept. 6, 2017, 1:33 a.m. | OK | GNU C++11 | TESTS | 137 | 30 | 1228800 | 2900 | |
| 29775681 | eddy1021 | E | Aug. 25, 2017, 9:52 a.m. | OK | GNU C++11 | TESTS | 137 | 30 | 1945600 | 2900 | |
| 30193938 | King_George | E | Sept. 8, 2017, 3:01 a.m. | OK | GNU C++11 | TESTS | 137 | 31 | 0 | 2900 | |
| 57873645 | lopare | E | July 28, 2019, 3:44 a.m. | OK | GNU C++11 | TESTS | 137 | 31 | 102400 | 2900 | |
| 38655613 | crazy_cloud | E | May 27, 2018, 12:50 p.m. | OK | GNU C++11 | TESTS | 137 | 31 | 102400 | 2900 | |
| 29915621 | apiadu | E | Aug. 30, 2017, 11:20 a.m. | OK | GNU C++14 | TESTS | 137 | 15 | 307200 | 2900 | |
| 29784697 | Hujiwara | E | Aug. 25, 2017, 3:04 p.m. | OK | GNU C++14 | TESTS | 137 | 15 | 307200 | 2900 | |
| 29772886 | Rafbill | E | Aug. 25, 2017, 7:59 a.m. | OK | GNU C++14 | TESTS | 137 | 15 | 409600 | 2900 | |
| 30027087 | irkstepanov | E | Sept. 3, 2017, 8:18 a.m. | OK | GNU C++14 | TESTS | 137 | 15 | 512000 | 2900 | |
| 29761229 | hogloid | E | Aug. 24, 2017, 9:22 p.m. | OK | GNU C++14 | TESTS | 137 | 15 | 614400 | 2900 | |
| 29784575 | Vladyslav | E | Aug. 25, 2017, 3 p.m. | OK | GNU C++14 | TESTS | 137 | 15 | 1126400 | 2900 | |
| 34945824 | MasterLuke | E | Feb. 5, 2018, 1:48 p.m. | OK | GNU C++14 | TESTS | 137 | 15 | 2662400 | 2900 | |
| 34939988 | LelouchRiBritannia | E | Feb. 5, 2018, 9:46 a.m. | OK | GNU C++14 | TESTS | 137 | 15 | 17203200 | 2900 | |
| 30237223 | mengrao | E | Sept. 10, 2017, 3:37 a.m. | OK | GNU C++14 | TESTS | 137 | 30 | 102400 | 2900 | |
| 29775083 | ainta | E | Aug. 25, 2017, 9:27 a.m. | OK | GNU C++14 | TESTS | 137 | 30 | 409600 | 2900 | |
| 59641057 | Nakagawa.Kanon | E | Aug. 29, 2019, 1:36 a.m. | OK | GNU C++17 | TESTS | 137 | 31 | 307200 | 2900 | |
| 59641032 | Nishihara | E | Aug. 29, 2019, 1:34 a.m. | OK | GNU C++17 | TESTS | 137 | 31 | 307200 | 2900 | |
| 42104869 | teapotd | E | Aug. 25, 2018, 10:50 p.m. | OK | GNU C++17 | TESTS | 137 | 31 | 307200 | 2900 | |
| 42187009 | Benq | E | Aug. 27, 2018, 10:16 p.m. | OK | GNU C++17 | TESTS | 137 | 31 | 512000 | 2900 | |
| 65161108 | YangDavid | E | Nov. 16, 2019, 11:24 a.m. | OK | GNU C++17 | TESTS | 137 | 31 | 921600 | 2900 | |
| 50810764 | zhangqingqi | E | March 5, 2019, 8:38 a.m. | OK | GNU C++17 | TESTS | 137 | 46 | 307200 | 2900 | |
| 56658434 | hjk1030 | E | July 7, 2019, 9:11 a.m. | OK | GNU C++17 | TESTS | 137 | 46 | 36147200 | 2900 | |
| 29756039 | niyaznigmatul | E | Aug. 24, 2017, 6:34 p.m. | OK | Java 8 | TESTS | 137 | 155 | 0 | 2900 | |
| 34416711 | vjudge3 | E | Jan. 21, 2018, 2:19 p.m. | OK | MS C++ | TESTS | 137 | 15 | 2355200 | 2900 | |
| 34416628 | ys1468362286 | E | Jan. 21, 2018, 2:16 p.m. | OK | MS C++ | TESTS | 137 | 31 | 2355200 | 2900 |
Back to search problems