Codeforces Round 397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined)

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
765 Codeforces Round 397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) FINISHED False 10800 250466123 Feb. 14, 2017, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2493 ) D Artsem and Saunders PROGRAMMING constructive algorithms ds math 1700

B'Artsem has a friend Saunders from University of Chicago. Saunders presented him with the following problem. Let [n] denote the set {1, xe2 x80 x89..., xe2 x80 x89n}. We will also write f: xe2 x80 x89[x] xe2 x80 x89 xe2 x86 x92 xe2 x80 x89[y] when a function f is defined in integer points 1, ..., x, and all its values are integers from 1 to y. Now then, you are given a function f: xe2 x80 x89[n] xe2 x80 x89 xe2 x86 x92 xe2 x80 x89[n]. Your task is to find a positive integer m, and two functions g: xe2 x80 x89[n] xe2 x80 x89 xe2 x86 x92 xe2 x80 x89[m], h: xe2 x80 x89[m] xe2 x80 x89 xe2 x86 x92 xe2 x80 x89[n], such that g(h(x)) xe2 x80 x89= xe2 x80 x89x for all , and h(g(x)) xe2 x80 x89= xe2 x80 x89f(x) for all , or determine that finding these is impossible. The first line contains an integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The second line contains n space-separated integers -- values f(1), xe2 x80 x89..., xe2 x80 x89f(n) (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89f(i) xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). If there is no answer, print one integer -1. Otherwise, on the first line print the number m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106). On the second line print n numbers g(1), xe2 x80 x89..., xe2 x80 x89g(n). On the third line print m numbers h(1), xe2 x80 x89..., xe2 x80 x89h(m). If there are several correct answers, you may output any of them. It is guaranteed that if a valid answer exists, then there is an answer satisfying the above restrictions. '...

Tutorials

Codeforces Round #397 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
24661679 TheHedgehog D Feb. 14, 2017, 9:48 a.m. OK Delphi TESTS 43 46 29593600 1700
24668629 Tommyr7 D Feb. 14, 2017, 12:03 p.m. OK FPC TESTS 43 295 2867200 1700
24686360 treash D Feb. 15, 2017, 5:18 a.m. OK FPC TESTS 43 296 2867200 1700
24665394 ShavelV D Feb. 14, 2017, 10:38 a.m. OK FPC TESTS 43 311 2867200 1700
24657701 bzh D Feb. 14, 2017, 9:08 a.m. OK FPC TESTS 43 327 3379200 1700
24674659 vjudge3 D Feb. 14, 2017, 3:42 p.m. OK FPC TESTS 43 327 3686400 1700
24675267 apt123 D Feb. 14, 2017, 4:06 p.m. OK FPC TESTS 43 342 3686400 1700
24659495 lkmcfj D Feb. 14, 2017, 9:24 a.m. OK FPC TESTS 43 342 4505600 1700
24672993 vjudge1 D Feb. 14, 2017, 2:39 p.m. OK FPC TESTS 43 358 3584000 1700
24682805 mostcleverboy D Feb. 14, 2017, 11:25 p.m. OK FPC TESTS 43 358 13619200 1700
24660523 almond D Feb. 14, 2017, 9:34 a.m. OK GNU C TESTS 43 46 3174400 1700
24661152 zzhao1996 D Feb. 14, 2017, 9:42 a.m. OK GNU C TESTS 43 46 4300800 1700
24659719 Tebak_Siapa_Aku D Feb. 14, 2017, 9:26 a.m. OK GNU C TESTS 43 61 3276800 1700
24680993 kuritsa D Feb. 14, 2017, 8:38 p.m. OK GNU C TESTS 43 62 2662400 1700
24676963 zzyang D Feb. 14, 2017, 5:18 p.m. OK GNU C TESTS 43 62 2662400 1700
24654850 Totodile17 D Feb. 14, 2017, 8:48 a.m. OK GNU C TESTS 43 62 3379200 1700
24687866 KinKong1 D Feb. 15, 2017, 6:57 a.m. OK GNU C TESTS 43 78 3174400 1700
24668110 Stalin. D Feb. 14, 2017, 11:54 a.m. OK GNU C++ TESTS 43 15 14233600 1700
24657974 DreamAct D Feb. 14, 2017, 9:10 a.m. OK GNU C++ TESTS 43 15 18022400 1700
24683835 zhanglexing D Feb. 15, 2017, 1:25 a.m. OK GNU C++ TESTS 43 30 3584000 1700
24654196 AkaneSasu D Feb. 14, 2017, 8:45 a.m. OK GNU C++ TESTS 43 30 3584000 1700
24662557 Herrwerner D Feb. 14, 2017, 9:58 a.m. OK GNU C++ TESTS 43 31 3481600 1700
24659011 cbhcbh D Feb. 14, 2017, 9:19 a.m. OK GNU C++ TESTS 43 31 6144000 1700
24655745 Dylans D Feb. 14, 2017, 8:54 a.m. OK GNU C++ TESTS 43 31 18227200 1700
24653731 xuyewen D Feb. 14, 2017, 8:42 a.m. OK GNU C++ TESTS 43 46 3174400 1700
34505881 vjudge1 D Jan. 24, 2018, 6:44 a.m. OK GNU C++ TESTS 43 46 3276800 1700
25776128 vjudge2 D March 24, 2017, 2:42 p.m. OK GNU C++ TESTS 43 46 3276800 1700
24679276 f2lk6wf90d D Feb. 14, 2017, 7:01 p.m. OK GNU C11 TESTS 43 93 3072000 1700
24775565 Arch0n D Feb. 18, 2017, 11:42 a.m. OK GNU C++11 TESTS 43 15 3276800 1700
24697675 VAVAvile D Feb. 15, 2017, 2:04 p.m. OK GNU C++11 TESTS 43 30 3481600 1700
24664884 sengxian D Feb. 14, 2017, 10:31 a.m. OK GNU C++11 TESTS 43 30 4096000 1700
24662407 ADM D Feb. 14, 2017, 9:56 a.m. OK GNU C++11 TESTS 43 30 7475200 1700
24658726 _ISA_ D Feb. 14, 2017, 9:16 a.m. OK GNU C++11 TESTS 43 31 4812800 1700
24688494 xsc D Feb. 15, 2017, 7:31 a.m. OK GNU C++11 TESTS 43 31 5529600 1700
24656079 BigBag D Feb. 14, 2017, 8:56 a.m. OK GNU C++11 TESTS 43 31 6348800 1700
24950727 HeZiying D Feb. 24, 2017, 12:02 a.m. OK GNU C++11 TESTS 43 31 17920000 1700
51249312 StartAgain D March 13, 2019, 7:35 a.m. OK GNU C++11 TESTS 43 46 2457600 1700
24650734 aid D Feb. 14, 2017, 8:29 a.m. OK GNU C++11 TESTS 43 46 2969600 1700
24652617 Egor.Lifar D Feb. 14, 2017, 8:37 a.m. OK GNU C++14 TESTS 43 15 16076800 1700
24653503 platypus179 D Feb. 14, 2017, 8:41 a.m. OK GNU C++14 TESTS 43 15 22835200 1700
24649900 Al.Cash D Feb. 14, 2017, 8:25 a.m. OK GNU C++14 TESTS 43 31 6758400 1700
24663232 equocredite D Feb. 14, 2017, 10:06 a.m. OK GNU C++14 TESTS 43 31 7270400 1700
59240225 lakshay_nasa D Aug. 21, 2019, 7:17 p.m. OK GNU C++14 TESTS 43 46 1228800 1700
40099059 Arkcy D July 9, 2018, 3:03 a.m. OK GNU C++14 TESTS 43 46 1228800 1700
29531790 ImagineDragons D Aug. 17, 2017, 5:37 p.m. OK GNU C++14 TESTS 43 46 1536000 1700
49372531 sirjan13 D Feb. 2, 2019, 6:03 p.m. OK GNU C++14 TESTS 43 46 1638400 1700
57945391 pvannvuILQD D July 29, 2019, 2:07 p.m. OK GNU C++14 TESTS 43 46 1638400 1700
32361793 helio D Nov. 16, 2017, 5:32 p.m. OK GNU C++14 TESTS 43 46 1638400 1700
62789436 sergioreinier D Oct. 17, 2019, 1:47 p.m. OK GNU C++17 TESTS 43 46 1228800 1700
60485144 vjudge5 D Sept. 13, 2019, 12:19 p.m. OK GNU C++17 TESTS 43 46 1331200 1700
62590289 Grapeee D Oct. 14, 2019, 8:43 p.m. OK GNU C++17 TESTS 43 46 2048000 1700
61577184 sammithkanur D Sept. 30, 2019, 9:45 p.m. OK GNU C++17 TESTS 43 61 1228800 1700
53217544 hjk1030 D April 24, 2019, 9:49 a.m. OK GNU C++17 TESTS 43 61 1638400 1700
52276076 _overrated_ D April 3, 2019, 2:50 p.m. OK GNU C++17 TESTS 43 61 1740800 1700
60332014 striker_killer D Sept. 10, 2019, 6:34 a.m. OK GNU C++17 TESTS 43 61 1843200 1700
53293804 vjudge4 D April 25, 2019, 4:42 p.m. OK GNU C++17 TESTS 43 61 4300800 1700
40717319 peach D July 24, 2018, 8:33 p.m. OK GNU C++17 TESTS 43 61 5632000 1700
49547385 lrvideckis D Feb. 7, 2019, 1:04 a.m. OK GNU C++17 TESTS 43 61 6041600 1700
62587630 sameep17264 yotin vaibhavpulastya D Oct. 14, 2019, 7:30 p.m. OK Java 8 TESTS 43 139 0 1700
24659691 fnch D Feb. 14, 2017, 9:25 a.m. OK Java 8 TESTS 43 139 21196800 1700
41681708 amnesiac_dusk D Aug. 17, 2018, 11:26 a.m. OK Java 8 TESTS 43 140 0 1700
60308086 Shady51 D Sept. 9, 2019, 2:42 p.m. OK Java 8 TESTS 43 140 6041600 1700
24661376 aspimp D Feb. 14, 2017, 9:44 a.m. OK Java 8 TESTS 43 140 20992000 1700
24662887 IgorKoval D Feb. 14, 2017, 10:02 a.m. OK Java 8 TESTS 43 140 21094400 1700
24664719 fetetriste D Feb. 14, 2017, 10:28 a.m. OK Java 8 TESTS 43 140 21196800 1700
24651972 ilyakor D Feb. 14, 2017, 8:33 a.m. OK Java 8 TESTS 43 140 21196800 1700
31951673 pushpendra1997 Ashutosh_Bang 7dan D Nov. 1, 2017, 1:34 p.m. OK Java 8 TESTS 43 155 4608000 1700
24754115 OnShuffle D Feb. 18, 2017, 8:18 a.m. OK Java 8 TESTS 43 155 21094400 1700
24668177 chokudai D Feb. 14, 2017, 11:55 a.m. OK Mono C# TESTS 43 451 24166400 1700
24668429 chokudai D Feb. 14, 2017, 11:59 a.m. OK Mono C# TESTS 43 483 24166400 1700
24686491 og.kostya D Feb. 15, 2017, 5:29 a.m. OK MS C# TESTS 43 78 13619200 1700
24655309 fiver D Feb. 14, 2017, 8:51 a.m. OK MS C# TESTS 43 93 98816000 1700
24659845 mircea85 D Feb. 14, 2017, 9:27 a.m. OK MS C# TESTS 43 108 28262400 1700
24669980 fr0st D Feb. 14, 2017, 12:40 p.m. OK MS C# TESTS 43 124 38092800 1700
24660256 renadeen D Feb. 14, 2017, 9:31 a.m. OK MS C# TESTS 43 187 51302400 1700
24688504 xsc D Feb. 15, 2017, 7:32 a.m. OK MS C++ TESTS 43 31 5734400 1700
24660855 superwatermelon D Feb. 14, 2017, 9:38 a.m. OK MS C++ TESTS 43 46 4608000 1700
64739375 vjudge5 D Nov. 12, 2019, 11:28 a.m. OK MS C++ TESTS 43 61 1228800 1700
24680925 darksidersstrife D Feb. 14, 2017, 8:34 p.m. OK MS C++ TESTS 43 61 4096000 1700
64744870 vjudge5 D Nov. 12, 2019, 1:12 p.m. OK MS C++ TESTS 43 61 4608000 1700
24661407 jyk D Feb. 14, 2017, 9:45 a.m. OK MS C++ TESTS 43 62 3276800 1700
24671844 Rafaaaaaaaaaaaam D Feb. 14, 2017, 1:53 p.m. OK MS C++ TESTS 43 62 3788800 1700
24659210 UminchuR D Feb. 14, 2017, 9:21 a.m. OK MS C++ TESTS 43 62 3993600 1700
24665186 Nadir_1120 D Feb. 14, 2017, 10:34 a.m. OK MS C++ TESTS 43 62 4096000 1700
24661650 dolboeb D Feb. 14, 2017, 9:48 a.m. OK MS C++ TESTS 43 62 4505600 1700
24670839 lovelymoon D Feb. 14, 2017, 1:11 p.m. OK PHP TESTS 43 810 34918400 1700
24663058 osev D Feb. 14, 2017, 10:04 a.m. OK PyPy 2 TESTS 43 93 34611200 1700
24718638 Ehzyo D Feb. 16, 2017, 1:21 p.m. OK PyPy 2 TESTS 43 124 33382400 1700
25565394 TangentOfA D March 17, 2017, 6:42 a.m. OK PyPy 2 TESTS 43 139 34508800 1700
25025628 ryanr1230 D Feb. 25, 2017, 11:40 p.m. OK PyPy 2 TESTS 43 717 36659200 1700
24660350 xhae D Feb. 14, 2017, 9:33 a.m. OK PyPy 2 TESTS 43 1169 31846400 1700
24780434 outeru D Feb. 18, 2017, 1:57 p.m. OK PyPy 3 TESTS 43 295 33177600 1700
31581116 yugle7 D Oct. 21, 2017, 4:42 p.m. OK PyPy 3 TESTS 43 311 46284800 1700
24653467 savsmail D Feb. 14, 2017, 8:40 a.m. OK PyPy 3 TESTS 43 311 52838400 1700
62727145 ananya17020 D Oct. 16, 2019, 4:44 p.m. OK PyPy 3 TESTS 43 327 15667200 1700
29520509 nealzane D Aug. 17, 2017, 7:03 a.m. OK Python 2 TESTS 43 202 9830400 1700
24749333 BIGCHENG D Feb. 18, 2017, 3:17 a.m. OK Python 2 TESTS 43 217 18227200 1700
24753173 BIGCHENG D Feb. 18, 2017, 7:22 a.m. OK Python 2 TESTS 43 218 13824000 1700
24662154 rajuknit D Feb. 14, 2017, 9:53 a.m. OK Python 2 TESTS 43 218 17100800 1700
24706393 danielfleischman D Feb. 15, 2017, 10:41 p.m. OK Python 2 TESTS 43 218 20992000 1700
24753093 BIGCHENG D Feb. 18, 2017, 7:16 a.m. OK Python 2 TESTS 43 233 18534400 1700
24703173 shinoi D Feb. 15, 2017, 6:42 p.m. OK Python 2 TESTS 43 249 12902400 1700
24709834 Flandr.Scarlet D Feb. 16, 2017, 5:13 a.m. OK Python 2 TESTS 43 249 13824000 1700
24666380 jrying D Feb. 14, 2017, 10:51 a.m. OK Python 2 TESTS 43 264 20787200 1700
24669121 edwardjrolls D Feb. 14, 2017, 12:16 p.m. OK Python 2 TESTS 43 280 31027200 1700
24738720 Martial D Feb. 17, 2017, 12:45 p.m. OK Python 3 TESTS 43 187 19148800 1700
25320909 tellmewhy SkeW Gardiys D March 7, 2017, 12:32 p.m. OK Python 3 TESTS 43 202 19148800 1700
24660574 Menci D Feb. 14, 2017, 9:35 a.m. OK Python 3 TESTS 43 218 16179200 1700
24663533 iehn D Feb. 14, 2017, 10:11 a.m. OK Python 3 TESTS 43 249 16281600 1700
25573195 Mopriestt D March 17, 2017, 1:10 p.m. OK Python 3 TESTS 43 249 19148800 1700
24652100 pashka D Feb. 14, 2017, 8:34 a.m. OK Python 3 TESTS 43 249 19558400 1700
24660823 DmitryGrigorev D Feb. 14, 2017, 9:38 a.m. OK Python 3 TESTS 43 265 22323200 1700
62726741 ananya17020 D Oct. 16, 2019, 4:42 p.m. OK Python 3 TESTS 43 514 13312000 1700
24663269 nanae1914 D Feb. 14, 2017, 10:07 a.m. OK Python 3 TESTS 43 577 28672000 1700
24668231 kishertka D Feb. 14, 2017, 11:55 a.m. OK Python 3 TESTS 43 592 11878400 1700
24658476 mio_h D Feb. 14, 2017, 9:14 a.m. OK Rust TESTS 43 61 21299200 1700
24651791 kobae964 D Feb. 14, 2017, 8:33 a.m. OK Rust TESTS 43 93 4505600 1700
24687097 mio_h D Feb. 15, 2017, 6:15 a.m. OK Rust TESTS 43 93 20787200 1700

remove filters

Back to search problems