Educational Codeforces Round 29

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
863 Educational Codeforces Round 29 FINISHED False 7200 225816899 Sept. 21, 2017, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1265 ) F Almost Permutation PROGRAMMING flows 2300

B"Recently Ivan noticed an array a while debugging his code. Now Ivan can't remember this array, but the bug he was trying to fix didn't go away, so Ivan thinks that the data from this array might help him to reproduce the bug. Ivan clearly remembers that there were n elements in the array, and each element was not less than 1 and not greater than n. Also he remembers q facts about the array. There are two types of facts that Ivan remembers: Also Ivan thinks that this array was a permutation, but he is not so sure about it. He wants to restore some array that corresponds to the q facts that he remembers and is very similar to permutation. Formally, Ivan has denoted the cost of array as follows: , where cnt(i) is the number of occurences of i in the array. Help Ivan to determine minimum possible cost of the array that corresponds to the facts! The first line contains two integer numbers n and q (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8950, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100). Then q lines follow, each representing a fact about the array. i-th line contains the numbers ti, li, ri and vi for i-th fact (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ti xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89li xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ri xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89vi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, ti denotes the type of the fact). If the facts are controversial and there is no array that corresponds to them, print -1. Otherwise, print minimum possible cost of the array. "...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
30627049 fluffyowl F Sept. 22, 2017, 11:31 p.m. OK D TESTS 45 374 13414400 2300
30805733 Worldwide_D F Sept. 28, 2017, 1:17 p.m. OK GNU C++ TESTS 45 15 0 2300
30897890 vincent163 F Oct. 1, 2017, 4:10 a.m. OK GNU C++ TESTS 45 15 102400 2300
30796727 MisakaKuma F Sept. 28, 2017, 6:46 a.m. OK GNU C++ TESTS 45 15 307200 2300
30732604 JialinOuyang F Sept. 25, 2017, 4:18 p.m. OK GNU C++ TESTS 45 15 307200 2300
30590857 nhho F Sept. 21, 2017, 4:24 p.m. OK GNU C++ TESTS 45 15 307200 2300
30861630 Lhtie F Sept. 30, 2017, 10:03 a.m. OK GNU C++ TESTS 45 15 409600 2300
30627698 Kallaseldor F Sept. 23, 2017, 1:06 a.m. OK GNU C++ TESTS 45 15 409600 2300
30595657 saharshluthra F Sept. 21, 2017, 5:45 p.m. OK GNU C++ TESTS 45 15 409600 2300
30662819 Slaaava F Sept. 24, 2017, 10:32 a.m. OK GNU C++ TESTS 45 15 512000 2300
30775114 554311694 F Sept. 27, 2017, 11:25 a.m. OK GNU C++ TESTS 45 15 716800 2300
30654454 TadijaSebez F Sept. 23, 2017, 10:58 p.m. OK GNU C++11 TESTS 45 15 102400 2300
30608245 Yehezkiel F Sept. 22, 2017, 7:28 a.m. OK GNU C++11 TESTS 45 15 102400 2300
30608228 Yehezkiel F Sept. 22, 2017, 7:27 a.m. OK GNU C++11 TESTS 45 15 102400 2300
31974125 a540524095 F Nov. 2, 2017, 9:45 a.m. OK GNU C++11 TESTS 45 15 204800 2300
31974007 a540524095 F Nov. 2, 2017, 9:40 a.m. OK GNU C++11 TESTS 45 15 204800 2300
31959202 a540524095 F Nov. 1, 2017, 5:51 p.m. OK GNU C++11 TESTS 45 15 204800 2300
30979021 krijgertje F Oct. 3, 2017, 9:27 p.m. OK GNU C++11 TESTS 45 15 204800 2300
30733193 Neumann F Sept. 25, 2017, 4:36 p.m. OK GNU C++11 TESTS 45 15 204800 2300
30593842 2013300262 F Sept. 21, 2017, 5:01 p.m. OK GNU C++11 TESTS 45 15 204800 2300
30593626 Hwhitetooth F Sept. 21, 2017, 4:59 p.m. OK GNU C++11 TESTS 45 15 204800 2300
30627306 Light F Sept. 23, 2017, 12:07 a.m. OK GNU C++14 TESTS 45 15 0 2300
31144142 cxt F Oct. 8, 2017, 12:38 p.m. OK GNU C++14 TESTS 45 15 204800 2300
30591128 JustasK F Sept. 21, 2017, 4:27 p.m. OK GNU C++14 TESTS 45 15 204800 2300
30589226 Benq F Sept. 21, 2017, 4:06 p.m. OK GNU C++14 TESTS 45 15 204800 2300
30587726 Fedosik F Sept. 21, 2017, 3:51 p.m. OK GNU C++14 TESTS 45 15 204800 2300
32070831 narcissist F Nov. 5, 2017, 8:09 a.m. OK GNU C++14 TESTS 45 15 307200 2300
30799626 unbelievable02 F Sept. 28, 2017, 9:01 a.m. OK GNU C++14 TESTS 45 15 307200 2300
30764645 KhaleD_ F Sept. 26, 2017, 11:11 p.m. OK GNU C++14 TESTS 45 15 307200 2300
30733281 TraceCJY F Sept. 25, 2017, 4:38 p.m. OK GNU C++14 TESTS 45 15 307200 2300
30606449 stczhc F Sept. 22, 2017, 5:39 a.m. OK GNU C++14 TESTS 45 15 307200 2300
47009297 karasek F Dec. 14, 2018, 3:35 p.m. OK GNU C++17 TESTS 45 15 819200 2300
37612615 vjudge4 F April 25, 2018, 6:48 p.m. OK GNU C++17 TESTS 45 15 3788800 2300
39075455 yaksha F June 9, 2018, 5:41 p.m. OK GNU C++17 TESTS 45 15 18022400 2300
51437223 amnesiac_dusk F March 18, 2019, 7:24 a.m. OK GNU C++17 TESTS 45 30 819200 2300
40303911 vjudge3 F July 14, 2018, 4:24 a.m. OK GNU C++17 TESTS 45 30 819200 2300
40235644 ViVuClone F July 12, 2018, 2:38 p.m. OK GNU C++17 TESTS 45 30 819200 2300
49761751 luogu_bot5 F Feb. 11, 2019, 9:22 a.m. OK GNU C++17 TESTS 45 30 1126400 2300
49761725 Fulisike F Feb. 11, 2019, 9:21 a.m. OK GNU C++17 TESTS 45 30 1126400 2300
55753983 Medeowex F June 19, 2019, 2:19 p.m. OK GNU C++17 TESTS 45 30 1638400 2300
55753564 Medeowex F June 19, 2019, 2:06 p.m. OK GNU C++17 TESTS 45 30 1638400 2300
67682407 zhanyi_xiaolu F Dec. 27, 2019, 7:05 a.m. OK Java 11 TESTS 45 217 204800 2300
30614251 Kharouba F Sept. 22, 2017, 12:29 p.m. OK Java 8 TESTS 45 109 0 2300
31925914 vovacomua F Oct. 31, 2017, 3:28 p.m. OK Java 8 TESTS 45 124 0 2300
30766936 JialinOuyang F Sept. 27, 2017, 3:40 a.m. OK Java 8 TESTS 45 124 0 2300
30766925 JialinOuyang F Sept. 27, 2017, 3:39 a.m. OK Java 8 TESTS 45 124 0 2300
30620754 Juniorandrade F Sept. 22, 2017, 4:42 p.m. OK Java 8 TESTS 45 124 0 2300
30590358 pitfall F Sept. 21, 2017, 4:18 p.m. OK Java 8 TESTS 45 124 0 2300
30588766 uwi F Sept. 21, 2017, 4:01 p.m. OK Java 8 TESTS 45 124 0 2300
33964749 svilen F Jan. 6, 2018, 2:40 p.m. OK Java 8 TESTS 45 124 21196800 2300
33971377 RP_9 F Jan. 6, 2018, 7:34 p.m. OK Java 8 TESTS 45 124 21504000 2300
31929401 vovacomua F Oct. 31, 2017, 5:45 p.m. OK Java 8 TESTS 45 139 2969600 2300
30594300 og.kostya F Sept. 21, 2017, 5:07 p.m. OK MS C# TESTS 45 62 2560000 2300
30625364 SakoXF F Sept. 22, 2017, 8:45 p.m. OK MS C++ TESTS 45 15 204800 2300
34420430 Maffka F Jan. 21, 2018, 4:55 p.m. OK MS C++ TESTS 45 15 2355200 2300
39016685 xsc F June 7, 2018, 10:53 a.m. OK MS C++ TESTS 45 31 307200 2300
66590818 vjudge3 F Dec. 10, 2019, 12:56 p.m. OK MS C++ TESTS 45 31 512000 2300
56188902 vjudge2 F June 28, 2019, 6:30 a.m. OK MS C++ TESTS 45 31 2150400 2300
66620669 vjudge2 F Dec. 11, 2019, 6:48 a.m. OK MS C++ 2017 TESTS 45 31 819200 2300
45981555 Guty F Nov. 20, 2018, 12:27 a.m. OK Python 3 TESTS 45 311 2048000 2300

remove filters

Back to search problems