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 |
317
|
Codeforces Round 188 (Div. 1) |
FINISHED |
False |
7200 |
360599399 |
June 14, 2013, 3:30 p.m. |
Problems
B'A system of n vessels with water is given. Several pairs of vessels are connected by tubes with transfusion mechanisms. One may transfer an integer amount of liters of water between two vessels connected by such tube (tube works in both directions). There might be multiple tubes between two vessels. Total number of tubes equals e. Volume of each vessel equals v liters. Of course, the amount of the water in any vessel cannot exceed v liters in the process of transfusions. Given the initial amounts ai of water in the vessels and the desired amounts bi find a sequence of transfusions that deals with the task. Total number of transfusions must not exceed 2 xc2 xb7n2. First line of the input contains integers n, v, e (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89300, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89e xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8950000). Next two lines contain n integers each: initial ai and the desired amounts bi of water in corresponding vessels (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai, xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89v). Next e lines describe one tube each in the format x y (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x, xe2 x80 x89y xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89x xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89y) for a tube between vessels number x and y. There might be multiple tubes between two vessels. You may assume that vessels are numbered from 1 to n in some way. Print "NO" (without quotes), if such sequence of transfusions does not exist. Otherwise print any suitable sequence in the following format. On the first line print the total number of transfusions k (k should not exceed 2 xc2 xb7n2). In the following k lines print transfusions in the format x y d (transfusion of d liters from the vessel number x to the vessel number y, x and y must be distinct). For all transfusions d must be a non-negative integer.'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
10235988 |
403369233 |
C |
March 11, 2015, 11:36 a.m. |
OK |
FPC |
TESTS |
55 |
92 |
3276800 |
|
2700 |
4032187 |
chipchip3412 |
C |
July 6, 2013, 6:34 p.m. |
OK |
FPC |
TESTS |
55 |
109 |
2867200 |
|
2700 |
4033986 |
PeterTong97 |
C |
July 7, 2013, 9:05 a.m. |
OK |
FPC |
TESTS |
55 |
125 |
3379200 |
|
2700 |
3930873 |
con_nha_ngheo |
C |
June 21, 2013, 6:26 a.m. |
OK |
FPC |
TESTS |
55 |
140 |
53350400 |
|
2700 |
4096405 |
yuxiaobhcs |
C |
July 18, 2013, 4:52 a.m. |
OK |
GNU C++ |
TESTS |
55 |
15 |
2355200 |
|
2700 |
3904702 |
mochavic |
C |
June 16, 2013, 10:14 a.m. |
OK |
GNU C++ |
TESTS |
55 |
15 |
3584000 |
|
2700 |
3912780 |
dhh1995 |
C |
June 18, 2013, 8:11 a.m. |
OK |
GNU C++ |
TESTS |
55 |
15 |
4403200 |
|
2700 |
5020532 |
sicasli |
C |
Nov. 7, 2013, 6:58 a.m. |
OK |
GNU C++ |
TESTS |
55 |
30 |
1126400 |
|
2700 |
15447846 |
hld67890 |
C |
Jan. 20, 2016, 5:10 a.m. |
OK |
GNU C++ |
TESTS |
55 |
30 |
4096000 |
|
2700 |
5321367 |
PSDEV |
C |
Dec. 1, 2013, 12:05 p.m. |
OK |
GNU C++ |
TESTS |
55 |
30 |
4403200 |
|
2700 |
8557465 |
Lazycal |
C |
Nov. 5, 2014, 11:52 a.m. |
OK |
GNU C++ |
TESTS |
55 |
30 |
5734400 |
|
2700 |
3897605 |
stevenkplus |
C |
June 14, 2013, 9:38 p.m. |
OK |
GNU C++ |
TESTS |
55 |
31 |
921600 |
|
2700 |
3892766 |
kelvin |
C |
June 14, 2013, 4:57 p.m. |
OK |
GNU C++ |
TESTS |
55 |
31 |
921600 |
|
2700 |
3912142 |
daidailanlan |
C |
June 18, 2013, 3:17 a.m. |
OK |
GNU C++ |
TESTS |
55 |
31 |
1024000 |
|
2700 |
3908845 |
MinakoKojima |
C |
June 17, 2013, 8:52 a.m. |
OK |
GNU C++0x |
TESTS |
55 |
46 |
1740800 |
|
2700 |
4165496 |
LovelyPenguin |
C |
July 25, 2013, 6:48 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
46 |
3891200 |
|
2700 |
5683915 |
mruxim |
C |
Jan. 13, 2014, 1:04 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
62 |
1945600 |
|
2700 |
8024606 |
equation314 |
C |
Sept. 29, 2014, 12:15 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
62 |
2560000 |
|
2700 |
3908864 |
MinakoKojima |
C |
June 17, 2013, 8:59 a.m. |
OK |
GNU C++0x |
TESTS |
55 |
78 |
1740800 |
|
2700 |
9161784 |
mnbvmar |
C |
Dec. 17, 2014, 1:09 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
92 |
2048000 |
|
2700 |
8378151 |
zshi |
C |
Oct. 24, 2014, 1:58 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
92 |
2662400 |
|
2700 |
3893835 |
PinkieDashForever |
C |
June 14, 2013, 5:11 p.m. |
OK |
GNU C++0x |
TESTS |
55 |
93 |
1740800 |
|
2700 |
3913426 |
tarni |
C |
June 18, 2013, 11:15 a.m. |
OK |
GNU C++0x |
TESTS |
55 |
93 |
2457600 |
|
2700 |
3913397 |
tarni |
C |
June 18, 2013, 11:07 a.m. |
OK |
GNU C++0x |
TESTS |
55 |
93 |
2560000 |
|
2700 |
20296416 |
NUOUN |
C |
Aug. 31, 2016, 7:53 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
30 |
6451200 |
|
2700 |
26475006 |
vjudge4 |
C |
April 18, 2017, 12:02 p.m. |
OK |
GNU C++11 |
TESTS |
55 |
60 |
4198400 |
|
2700 |
32797233 |
131441373 |
C |
Nov. 30, 2017, 6:48 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
60 |
5017600 |
|
2700 |
11702279 |
WHITE2302 |
C |
June 21, 2015, 9:40 p.m. |
OK |
GNU C++11 |
TESTS |
55 |
62 |
1126400 |
|
2700 |
12570124 |
a654889339 |
C |
Aug. 17, 2015, 5:04 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
62 |
1638400 |
|
2700 |
11017312 |
tanphatls987 |
C |
May 7, 2015, 1:34 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
62 |
1638400 |
|
2700 |
11006984 |
geniucos |
C |
May 5, 2015, 4:01 p.m. |
OK |
GNU C++11 |
TESTS |
55 |
62 |
1638400 |
|
2700 |
21240395 |
DSSGSRA |
C |
Oct. 6, 2016, 4:18 p.m. |
OK |
GNU C++11 |
TESTS |
55 |
62 |
2764800 |
|
2700 |
23498850 |
Charles_Han |
C |
Jan. 2, 2017, 12:34 p.m. |
OK |
GNU C++11 |
TESTS |
55 |
62 |
3276800 |
|
2700 |
11694660 |
hzwer |
C |
June 21, 2015, 10:02 a.m. |
OK |
GNU C++11 |
TESTS |
55 |
62 |
3276800 |
|
2700 |
29734924 |
Egor.Lifar |
C |
Aug. 24, 2017, 3:37 p.m. |
OK |
GNU C++14 |
TESTS |
55 |
60 |
3276800 |
|
2700 |
24349922 |
chemthan |
C |
Feb. 1, 2017, 4:33 p.m. |
OK |
GNU C++14 |
TESTS |
55 |
62 |
29696000 |
|
2700 |
61211312 |
dyxg |
C |
Sept. 24, 2019, 11:34 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
92 |
1536000 |
|
2700 |
42873041 |
radoslav11 |
C |
Sept. 14, 2018, 8:32 p.m. |
OK |
GNU C++14 |
TESTS |
55 |
92 |
1843200 |
|
2700 |
25355943 |
DEGwer |
C |
March 9, 2017, 8:45 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
92 |
4403200 |
|
2700 |
50582459 |
DeadPillow |
C |
Feb. 27, 2019, 10:56 p.m. |
OK |
GNU C++14 |
TESTS |
55 |
122 |
1638400 |
|
2700 |
45118837 |
dasinlsb |
C |
Oct. 31, 2018, 1:29 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
124 |
1740800 |
|
2700 |
51433504 |
bilau_de_campina |
C |
March 18, 2019, 3:56 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
124 |
2560000 |
|
2700 |
23641753 |
Ali.Pi |
C |
Jan. 8, 2017, 7:15 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
124 |
3174400 |
|
2700 |
34966348 |
sincerity |
C |
Feb. 6, 2018, 9:38 a.m. |
OK |
GNU C++14 |
TESTS |
55 |
124 |
46387200 |
|
2700 |
62248063 |
ivan100sic |
C |
Oct. 10, 2019, 7:49 a.m. |
OK |
GNU C++17 |
TESTS |
55 |
92 |
1843200 |
|
2700 |
65839977 |
hjk1030 |
C |
Nov. 27, 2019, 2:19 p.m. |
OK |
GNU C++17 |
TESTS |
55 |
92 |
2048000 |
|
2700 |
53464939 |
ruo |
C |
April 28, 2019, 9:29 a.m. |
OK |
GNU C++17 |
TESTS |
55 |
92 |
2560000 |
|
2700 |
3928444 |
hiukim |
C |
June 20, 2013, 10:50 a.m. |
OK |
Java 6 |
TESTS |
55 |
234 |
307200 |
|
2700 |
3893656 |
ivan.metelsky |
C |
June 14, 2013, 5:09 p.m. |
OK |
Java 7 |
TESTS |
55 |
203 |
204800 |
|
2700 |
3894824 |
cerealguy |
C |
June 14, 2013, 5:22 p.m. |
OK |
Java 7 |
TESTS |
55 |
234 |
716800 |
|
2700 |
3917673 |
IgorKoval |
C |
June 19, 2013, 1:11 p.m. |
OK |
Java 7 |
TESTS |
55 |
250 |
102400 |
|
2700 |
3916693 |
xenoslash |
C |
June 19, 2013, 8:33 a.m. |
OK |
Java 7 |
TESTS |
55 |
265 |
409600 |
|
2700 |
3897379 |
fetetriste |
C |
June 14, 2013, 8:53 p.m. |
OK |
Java 7 |
TESTS |
55 |
312 |
307200 |
|
2700 |
3897365 |
fetetriste |
C |
June 14, 2013, 8:50 p.m. |
OK |
Java 7 |
TESTS |
55 |
312 |
307200 |
|
2700 |
3896055 |
Jokser |
C |
June 14, 2013, 6:38 p.m. |
OK |
Java 7 |
TESTS |
55 |
343 |
614400 |
|
2700 |
3907118 |
Ahmed_Salama |
C |
June 16, 2013, 6:58 p.m. |
OK |
Java 7 |
TESTS |
55 |
593 |
409600 |
|
2700 |
3907157 |
Ahmed_Salama |
C |
June 16, 2013, 7:11 p.m. |
OK |
Java 7 |
TESTS |
55 |
703 |
409600 |
|
2700 |
15201090 |
AndreiNet |
C |
Jan. 6, 2016, 7:54 a.m. |
OK |
Java 8 |
TESTS |
55 |
248 |
0 |
|
2700 |
3902404 |
NVAL |
C |
June 15, 2013, 5:24 p.m. |
OK |
MS C++ |
TESTS |
55 |
31 |
1433600 |
|
2700 |
3899666 |
Im_too_old_for_this_shit |
C |
June 15, 2013, 7:05 a.m. |
OK |
MS C++ |
TESTS |
55 |
31 |
9113600 |
|
2700 |
4567340 |
lzsb |
C |
Sept. 26, 2013, 1:10 p.m. |
OK |
MS C++ |
TESTS |
55 |
62 |
3584000 |
|
2700 |
3892836 |
SergeyRogulenko |
C |
June 14, 2013, 4:58 p.m. |
OK |
MS C++ |
TESTS |
55 |
78 |
2457600 |
|
2700 |
3900749 |
GlebsHP |
C |
June 15, 2013, 10:56 a.m. |
OK |
MS C++ |
TESTS |
55 |
109 |
2355200 |
|
2700 |
3893514 |
al13n |
C |
June 14, 2013, 5:07 p.m. |
OK |
MS C++ |
TESTS |
55 |
125 |
1228800 |
|
2700 |
3921210 |
iceman_w |
C |
June 19, 2013, 4 p.m. |
OK |
MS C++ |
TESTS |
55 |
156 |
1740800 |
|
2700 |
3904873 |
sleepycoder |
C |
June 16, 2013, 11:19 a.m. |
OK |
MS C++ |
TESTS |
55 |
343 |
1536000 |
|
2700 |
4043226 |
Rad0miR |
C |
July 9, 2013, 3:57 p.m. |
OK |
MS C++ |
TESTS |
55 |
546 |
3174400 |
|
2700 |
7682018 |
apia |
C |
Sept. 4, 2014, 1:01 p.m. |
OK |
Python 2 |
TESTS |
55 |
436 |
2355200 |
|
2700 |
remove filters
Back to search problems