Codeforces Round 419 (Div. 1)

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
815 Codeforces Round 419 (Div. 1) FINISHED False 7200 278695523 June 17, 2017, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 749 ) D Karen and Cards PROGRAMMING binary search combinatorics data structures geometry 2700

Karen just got home from the supermarket, and is getting ready to go to sleep. After taking a shower and changing into her pajamas, she looked at her shelf and saw an album. Curious, she opened it and saw a trading card collection. She recalled that she used to play with those cards as a child, and, although she is now grown-up, she still wonders a few things about it. Each card has three characteristics: strength , defense and speed . The values of all characteristics of all cards are positive integers. The maximum possible strength any card can have is p , the maximum possible defense is q and the maximum possible speed is r . There are n cards in her collection. The i -th card has a strength a i , defense b i and speed c i , respectively. A card beats another card if at least two of its characteristics are strictly greater than the corresponding characteristics of the other card. She now wonders how many different cards can beat all the cards in her collection. Two cards are considered different if at least one of their characteristics have different values. The first line of input contains four integers, n , p , q and r ( 1 ≤ n , p , q , r ≤ 500000 ), the number of cards in the collection, the maximum possible strength, the maximum possible defense, and the maximum possible speed, respectively. The next n lines each contain three integers. In particular, the i -th line contains a i , b i and c i ( 1 ≤ a i ≤ p , 1 ≤ b i ≤ q , 1 ≤ c i ≤ r ), the strength, defense and speed of the i -th collection card, respectively. Output a single integer on a line by itself, the number of different cards that can beat all the cards in her collection. In the first test case, the maximum possible strength is 4 , the maximum possible defense is 4 and the maximum possible speed is 5 . Karen has three cards: The first card has strength 2 , defense 2 and speed 5 . The second card has strength 1 , defense 3 and speed 4 . The third card has strength 4 , defense 1 and speed 1 .

Tutorials

Codeforces Round #419 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
29962294 wzf2000 D Sept. 1, 2017, 12:59 a.m. OK GNU C++ TESTS 112 124 18022400 2700
28775029 Parachutes D July 22, 2017, 9:40 a.m. OK GNU C++ TESTS 112 124 18124800 2700
27907291 xzyxzy D June 19, 2017, 2:57 p.m. OK GNU C++ TESTS 112 171 14028800 2700
27907246 xzyxzy D June 19, 2017, 2:54 p.m. OK GNU C++ TESTS 112 187 14028800 2700
39110646 Wallyssaa D June 10, 2018, 11:30 a.m. OK GNU C++ TESTS 112 218 12083200 2700
27875518 laofudasuan D June 18, 2017, 3:26 a.m. OK GNU C++ TESTS 112 218 56115200 2700
40659589 luogu_bot2 D July 23, 2018, 6:25 a.m. OK GNU C++ TESTS 112 249 20582400 2700
40659565 AutumnKite D July 23, 2018, 6:24 a.m. OK GNU C++ TESTS 112 249 20582400 2700
40652708 luogu_bot4 D July 23, 2018, 12:59 a.m. OK GNU C++ TESTS 112 264 20684800 2700
27903976 AkaneSasu D June 19, 2017, 12:01 p.m. OK GNU C++ TESTS 112 265 20582400 2700
50685264 __23333 D March 2, 2019, 1:23 p.m. OK GNU C++11 TESTS 112 109 12083200 2700
50882060 Zhang_RQ D March 6, 2019, 9:20 a.m. OK GNU C++11 TESTS 112 109 13004800 2700
40980757 ReaLNero1 D July 30, 2018, 5:40 p.m. OK GNU C++11 TESTS 112 109 17100800 2700
27901548 atatomir D June 19, 2017, 9:54 a.m. OK GNU C++11 TESTS 112 109 17100800 2700
31577707 hawkomg D Oct. 21, 2017, 2:34 p.m. OK GNU C++11 TESTS 112 109 24166400 2700
49830793 dengyixuan D Feb. 12, 2019, 1:49 p.m. OK GNU C++11 TESTS 112 124 18022400 2700
49928042 dengyixuan D Feb. 15, 2019, 1:34 a.m. OK GNU C++11 TESTS 112 124 72192000 2700
49928005 dengyixuan D Feb. 15, 2019, 1:31 a.m. OK GNU C++11 TESTS 112 124 72192000 2700
50144837 talandar D Feb. 19, 2019, 2:55 a.m. OK GNU C++11 TESTS 112 140 16076800 2700
69705290 luogu_bot3 D Jan. 29, 2020, 4:10 a.m. OK GNU C++11 TESTS 112 202 20582400 2700
28187942 Gintoki D July 1, 2017, 8:55 a.m. OK GNU C++14 TESTS 112 109 16179200 2700
28244306 LiChenKoh D July 3, 2017, 5:09 a.m. OK GNU C++14 TESTS 112 280 24166400 2700
27878290 lys1280023 D June 18, 2017, 6:47 a.m. OK GNU C++14 TESTS 112 358 7987200 2700
28187859 Gintoki D July 1, 2017, 8:52 a.m. OK GNU C++14 TESTS 112 358 14131200 2700
56878856 KeyID D July 12, 2019, 9:27 a.m. OK GNU C++14 TESTS 112 374 22016000 2700
27940603 jasonvictoryan D June 21, 2017, 8:17 a.m. OK GNU C++14 TESTS 112 390 15974400 2700
27940393 jasonvictoryan D June 21, 2017, 8:08 a.m. OK GNU C++14 TESTS 112 390 15974400 2700
27862042 anta D June 17, 2017, 4:09 p.m. OK GNU C++14 TESTS 112 405 12083200 2700
35340612 jslijin D Feb. 16, 2018, 2:32 p.m. OK GNU C++14 TESTS 112 405 21913600 2700
44333375 how_to_become_purple D Oct. 14, 2018, 7:38 p.m. OK GNU C++14 TESTS 112 405 24473600 2700
51960126 CMXRYNP D March 29, 2019, 6:17 a.m. OK GNU C++17 TESTS 112 124 10956800 2700
61255931 kefaa2 D Sept. 25, 2019, 10:05 a.m. OK GNU C++17 TESTS 112 483 26624000 2700
44775908 Shayan.P D Oct. 24, 2018, 2:20 p.m. OK GNU C++17 TESTS 112 530 60108800 2700
44775993 Shayan.P D Oct. 24, 2018, 2:22 p.m. OK GNU C++17 TESTS 112 545 60416000 2700
37532745 des3ns1tized_ D April 22, 2018, 12:09 p.m. OK GNU C++17 TESTS 112 670 17715200 2700
60286666 user202729_ D Sept. 9, 2019, 3:12 a.m. OK GNU C++17 TESTS 112 670 34304000 2700
61683376 vjudge2 D Oct. 2, 2019, 2:34 a.m. OK GNU C++17 TESTS 112 685 108236800 2700
61683216 vjudge3 D Oct. 2, 2019, 2:29 a.m. OK GNU C++17 TESTS 112 686 108236800 2700
60722715 ei133333 D Sept. 17, 2019, 12:54 p.m. OK GNU C++17 TESTS 112 717 42598400 2700
61797712 Umi D Oct. 3, 2019, 5:49 p.m. OK GNU C++17 TESTS 112 732 66764800 2700
27862907 mmaxio D June 17, 2017, 4:16 p.m. OK Java 8 TESTS 112 592 33484800 2700
27860558 uwi D June 17, 2017, 3:56 p.m. OK Java 8 TESTS 112 1138 42086400 2700
27869701 Lewin D June 17, 2017, 7:37 p.m. OK Java 8 TESTS 112 1871 84684800 2700
27882481 Filyan D June 18, 2017, 10:25 a.m. OK MS C++ TESTS 112 358 14131200 2700
42791688 fwat D Sept. 12, 2018, 8:57 a.m. OK MS C++ TESTS 112 763 12288000 2700
42791757 fwat D Sept. 12, 2018, 9 a.m. OK MS C++ TESTS 112 826 22323200 2700

remove filters

Back to search problems