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 244763699 Feb. 14, 2017, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2084 ) F Souvenirs PROGRAMMING data structures 2500

B"Artsem is on vacation and wants to buy souvenirs for his two teammates. There are n souvenir shops along the street. In i-th shop Artsem can buy one souvenir for ai dollars, and he cannot buy more than one souvenir in one shop. He doesn't want to introduce envy in his team, so he wants to buy two souvenirs with least possible difference in price. Artsem has visited the shopping street m times. For some strange reason on the i-th day only shops with numbers from li to ri were operating (weird? yes it is, but have you ever tried to come up with a reasonable legend for a range query problem?). For each visit, Artsem wants to know the minimum possible difference in prices of two different souvenirs he can buy in the opened shops. In other words, for each Artsem's visit you should find the minimum possible value of |as xe2 x80 x89- xe2 x80 x89at| where li xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89s, xe2 x80 x89t xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ri, s xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89t. The first line contains an integer n (2 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 a1, ..., an (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). The third line contains the number of queries m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x893 xc2 xb7105). Next m lines describe the queries. i-th of these lines contains two space-separated integers li and ri denoting the range of shops working on i-th day (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89li xe2 x80 x89< xe2 x80 x89ri xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). Print the answer to each query in a separate line. "...

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
24953817 zhanggengchen F Feb. 24, 2017, 3:50 a.m. OK FPC TESTS 51 1231 23347200 2500
24800810 vjudge5 F Feb. 19, 2017, 11:36 a.m. OK FPC TESTS 51 1279 10137600 2500
24800738 apt123 F Feb. 19, 2017, 11:32 a.m. OK FPC TESTS 51 1419 10137600 2500
24800828 apt123 F Feb. 19, 2017, 11:37 a.m. OK FPC TESTS 51 1528 10137600 2500
24953724 vjudge5 F Feb. 24, 2017, 3:43 a.m. OK FPC TESTS 51 1560 57036800 2500
24757711 lkmcfj F Feb. 18, 2017, 9:24 a.m. OK FPC TESTS 51 1824 57036800 2500
37395587 Trisolaris F April 17, 2018, 12:49 p.m. OK GNU C++ TESTS 51 249 30515200 2500
40982512 ReaLNero1 F July 30, 2018, 6:27 p.m. OK GNU C++ TESTS 51 265 15667200 2500
25359805 Spylft F March 9, 2017, 12:34 p.m. OK GNU C++ TESTS 51 265 17715200 2500
37395667 Trisolaris F April 17, 2018, 12:52 p.m. OK GNU C++ TESTS 51 280 19251200 2500
25028608 Chenhongkan F Feb. 26, 2017, 5:34 a.m. OK GNU C++ TESTS 51 280 19353600 2500
37395575 Trisolaris F April 17, 2018, 12:48 p.m. OK GNU C++ TESTS 51 280 30412800 2500
37395626 Trisolaris F April 17, 2018, 12:51 p.m. OK GNU C++ TESTS 51 280 30617600 2500
37395564 Trisolaris F April 17, 2018, 12:48 p.m. OK GNU C++ TESTS 51 280 30924800 2500
37395452 Trisolaris F April 17, 2018, 12:44 p.m. OK GNU C++ TESTS 51 280 30924800 2500
25028644 Chenhongkan F Feb. 26, 2017, 5:37 a.m. OK GNU C++ TESTS 51 295 17715200 2500
55612277 RedStar_13 F June 16, 2019, 6:39 a.m. OK GNU C++11 TESTS 51 296 16486400 2500
34099115 wzp666 F Jan. 12, 2018, 2:23 a.m. OK GNU C++11 TESTS 51 373 23347200 2500
45794437 mogician6 F Nov. 16, 2018, 9:32 a.m. OK GNU C++11 TESTS 51 374 14233600 2500
45794424 mogician6 F Nov. 16, 2018, 9:32 a.m. OK GNU C++11 TESTS 51 405 14336000 2500
27918508 vjudge1 F June 20, 2017, 6:28 a.m. OK GNU C++11 TESTS 51 405 24166400 2500
24733580 YaShem F Feb. 17, 2017, 7:38 a.m. OK GNU C++11 TESTS 51 405 27443200 2500
45973018 includehdhd F Nov. 19, 2018, 4:54 p.m. OK GNU C++11 TESTS 51 420 15769600 2500
68587839 luotc_why F Jan. 11, 2020, 11:48 a.m. OK GNU C++11 TESTS 51 420 30617600 2500
39693137 yukuai26 F June 27, 2018, 6:44 a.m. OK GNU C++11 TESTS 51 421 22220800 2500
25295548 phlirock F March 6, 2017, 2:55 p.m. OK GNU C++11 TESTS 51 421 28672000 2500
35331609 Forever_CHTHOLLY F Feb. 16, 2018, 9:05 a.m. OK GNU C++14 TESTS 51 420 16896000 2500
24689631 xsc F Feb. 15, 2017, 8:23 a.m. OK GNU C++14 TESTS 51 436 26726400 2500
31500610 bluefog F Oct. 19, 2017, 7:51 a.m. OK GNU C++14 TESTS 51 452 17510400 2500
24670489 MrDindows F Feb. 14, 2017, 12:56 p.m. OK GNU C++14 TESTS 51 468 97382400 2500
24670904 MrDindows F Feb. 14, 2017, 1:14 p.m. OK GNU C++14 TESTS 51 483 18227200 2500
24670698 MrDindows F Feb. 14, 2017, 1:05 p.m. OK GNU C++14 TESTS 51 483 20480000 2500
45904725 rushcheyo F Nov. 18, 2018, 7:46 a.m. OK GNU C++14 TESTS 51 498 21913600 2500
32143358 Joselsneto F Nov. 8, 2017, 5:29 p.m. OK GNU C++14 TESTS 51 499 18432000 2500
37873834 choutii F May 4, 2018, 2:35 a.m. OK GNU C++14 TESTS 51 499 177561600 2500
27449265 chenzezheng F May 30, 2017, 1:39 p.m. OK GNU C++14 TESTS 51 545 23859200 2500
60489305 vjudge4 F Sept. 13, 2019, 1:52 p.m. OK GNU C++17 TESTS 51 842 16384000 2500
60489034 vjudge2 F Sept. 13, 2019, 1:47 p.m. OK GNU C++17 TESTS 51 842 16384000 2500
60488994 vjudge5 F Sept. 13, 2019, 1:46 p.m. OK GNU C++17 TESTS 51 873 16384000 2500
40032682 dream_maker F July 6, 2018, 2:17 p.m. OK GNU C++17 TESTS 51 904 25804800 2500
47085795 xz153531 F Dec. 16, 2018, 2:30 a.m. OK GNU C++17 TESTS 51 951 8806400 2500
60672918 vjudge4 F Sept. 16, 2019, 11:27 a.m. OK GNU C++17 TESTS 51 951 86630400 2500
40032542 dream_maker F July 6, 2018, 2:10 p.m. OK GNU C++17 TESTS 51 998 19763200 2500
60488501 vjudge2 F Sept. 13, 2019, 1:36 p.m. OK GNU C++17 TESTS 51 998 73420800 2500
60288164 Kuroni F Sept. 9, 2019, 4:49 a.m. OK GNU C++17 TESTS 51 1029 11571200 2500
60488594 vjudge5 F Sept. 13, 2019, 1:38 p.m. OK GNU C++17 TESTS 51 1029 73420800 2500
31911127 uwi F Oct. 31, 2017, 5:31 a.m. OK Java 8 TESTS 51 1201 56832000 2500
31906714 uwi F Oct. 30, 2017, 10:06 p.m. OK Java 8 TESTS 51 1216 56832000 2500
31906454 uwi F Oct. 30, 2017, 9:50 p.m. OK Java 8 TESTS 51 1325 80896000 2500
24839969 IgorKoval F Feb. 20, 2017, 5:08 p.m. OK Java 8 TESTS 51 1575 40960000 2500
24857116 IgorKoval F Feb. 20, 2017, 10:59 p.m. OK Java 8 TESTS 51 1699 38195200 2500
24857186 IgorKoval F Feb. 20, 2017, 11:03 p.m. OK Java 8 TESTS 51 1762 38195200 2500
60511359 vjudge3 F Sept. 14, 2019, 3:14 a.m. OK MS C++ TESTS 51 1185 84172800 2500
57574353 nuchenghao F July 23, 2019, 6:29 a.m. OK MS C++ 2017 TESTS 51 1528 24371200 2500

remove filters

Back to search problems