Codeforces Round 546 (Div. 2)

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
1136 Codeforces Round 546 (Div. 2) FINISHED False 7200 179501099 March 11, 2019, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3830 ) D Nastya Is Buying Lunch PROGRAMMING greedy 1800

B"At the big break Nastya came to the school dining room. There are n pupils in the school, numbered from 1 to n . Unfortunately, Nastya came pretty late, so that all pupils had already stood in the queue, i.e. Nastya took the last place in the queue. Of course, it's a little bit sad for Nastya, but she is not going to despond because some pupils in the queue can agree to change places with some other pupils. Formally, there are some pairs u , v such that if the pupil with number u stands directly in front of the pupil with number v , Nastya can ask them and they will change places. Nastya asks you to find the maximal number of places in queue she can move forward. The first line contains two integers n and m ( 1 <= q n <= q 3 cdot 10^{5} , 0 <= q m <= q 5 cdot 10^{5} ) -- the number of pupils in the queue and number of pairs of pupils such that the first one agrees to change places with the second one if the first is directly in front of the second. The second line contains n integers p_1 , p_2 , ..., p_n -- the initial arrangement of pupils in the queue, from the queue start to its end ( 1 <= q p_i <= q n , p is a permutation of integers from 1 to n ). In other words, p_i is the number of the pupil who stands on the i -th position in the queue. The i -th of the following m lines contains two integers u_i , v_i ( 1 <= q u_i, v_i <= q n, u_i neq v_i ), denoting that the pupil with number u_i agrees to change places with the pupil with number v_i if u_i is directly in front of v_i . It is guaranteed that if i neq j , than v_i neq v_j or u_i neq u_j . Note that it is possible that in some pairs both pupils agree to change places with each other. Nastya is the last person in the queue, i.e. the pupil with number p_n . Print a single integer -- the number of places in"...

Tutorials

Editorial of Round #546(Div.2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56527109 vjudge4 D July 4, 2019, 5:39 p.m. OK Clang++17 Diagnostics TESTS 70 920 33280000 1800
56527511 vjudge5 D July 4, 2019, 5:52 p.m. OK Clang++17 Diagnostics TESTS 70 935 33382400 1800
51189400 avm D March 11, 2019, 5:52 p.m. OK D TESTS 70 187 32870400 1800
52504372 rr_ D April 8, 2019, 5:48 p.m. OK D TESTS 70 483 36147200 1800
52069143 sansen D March 31, 2019, 7 a.m. OK GNU C11 TESTS 70 218 7577600 1800
51187955 rainboy D March 11, 2019, 5:42 p.m. OK GNU C11 TESTS 70 218 7884800 1800
64057690 disposrestfuIly D Nov. 2, 2019, 2:16 a.m. OK GNU C++11 TESTS 70 78 8396800 1800
51485618 secret42 D March 19, 2019, 1:26 p.m. OK GNU C++11 TESTS 70 78 14028800 1800
51404809 mdp D March 17, 2019, 9:17 a.m. OK GNU C++11 TESTS 70 93 11878400 1800
51200400 filler_text D March 11, 2019, 10:20 p.m. OK GNU C++11 TESTS 70 93 11878400 1800
52588085 vjudge4 D April 11, 2019, 2:48 a.m. OK GNU C++11 TESTS 70 93 12902400 1800
51247154 Immortal.S D March 13, 2019, 6:08 a.m. OK GNU C++11 TESTS 70 93 16076800 1800
51352655 htcheck D March 16, 2019, 12:18 a.m. OK GNU C++11 TESTS 70 93 16998400 1800
51182376 dsbsxz D March 11, 2019, 5:12 p.m. OK GNU C++11 TESTS 70 93 30924800 1800
51410489 kadNaN D March 17, 2019, 11:51 a.m. OK GNU C++11 TESTS 70 109 7782400 1800
51418352 luogu_bot5 D March 17, 2019, 3:13 p.m. OK GNU C++11 TESTS 70 109 11366400 1800
51745502 winer00 D March 23, 2019, 7:30 a.m. OK GNU C++14 TESTS 70 234 12288000 1800
51185377 Linkus D March 11, 2019, 5:27 p.m. OK GNU C++14 TESTS 70 249 20070400 1800
51379350 yhf_2015 D March 16, 2019, 3:31 p.m. OK GNU C++14 TESTS 70 265 10547200 1800
52538878 igorqs D April 9, 2019, 5:01 p.m. OK GNU C++14 TESTS 70 280 3584000 1800
51231543 sabertooth D March 12, 2019, 4:30 p.m. OK GNU C++14 TESTS 70 295 11468800 1800
51202795 jeong D March 12, 2019, 1:49 a.m. OK GNU C++14 TESTS 70 295 12083200 1800
51377858 nong D March 16, 2019, 2:53 p.m. OK GNU C++14 TESTS 70 295 12697600 1800
51245854 evenharder D March 13, 2019, 5:06 a.m. OK GNU C++14 TESTS 70 295 13824000 1800
51584419 cloudsky01 D March 20, 2019, 3:44 p.m. OK GNU C++14 TESTS 70 295 32051200 1800
52570562 Koo_ D April 10, 2019, 2:02 p.m. OK GNU C++14 TESTS 70 296 7577600 1800
52744833 nickluo D April 14, 2019, 11:05 a.m. OK GNU C++17 TESTS 70 124 11980800 1800
51232991 .tx D March 12, 2019, 5:12 p.m. OK GNU C++17 TESTS 70 124 12697600 1800
52772461 henu-wxj D April 15, 2019, 9:52 a.m. OK GNU C++17 TESTS 70 202 10854400 1800
51885541 wjfwjfwjf D March 27, 2019, 6:07 a.m. OK GNU C++17 TESTS 70 249 11468800 1800
64554415 vjudge5 D Nov. 9, 2019, 2:31 a.m. OK GNU C++17 TESTS 70 280 12902400 1800
51203331 woshiluo D March 12, 2019, 2:23 a.m. OK GNU C++17 TESTS 70 296 7782400 1800
51382631 VaVshchuck D March 16, 2019, 5:05 p.m. OK GNU C++17 TESTS 70 296 11468800 1800
51239097 Turing.Machine D March 12, 2019, 8:19 p.m. OK GNU C++17 TESTS 70 296 12083200 1800
51267703 yyzs123 D March 13, 2019, 4:24 p.m. OK GNU C++17 TESTS 70 296 13004800 1800
51244960 LIULIUii D March 13, 2019, 3:58 a.m. OK GNU C++17 TESTS 70 296 44544000 1800
51393721 msg555 D March 17, 2019, 2:29 a.m. OK Go TESTS 70 234 23244800 1800
51480699 2008061626 D March 19, 2019, 11:28 a.m. OK Go TESTS 70 904 9523200 1800
51480276 2008061626 D March 19, 2019, 11:18 a.m. OK Go TESTS 70 967 23142400 1800
51480186 2008061626 D March 19, 2019, 11:16 a.m. OK Go TESTS 70 1028 32051200 1800
51228706 Ahmad D March 12, 2019, 3:12 p.m. OK Java 8 TESTS 70 218 14950400 1800
51190405 iceburst D March 11, 2019, 5:59 p.m. OK Java 8 TESTS 70 249 16588800 1800
51210262 xodiac D March 12, 2019, 7:29 a.m. OK Java 8 TESTS 70 265 19865600 1800
51271720 StayAwayFromBitches D March 13, 2019, 6:21 p.m. OK Java 8 TESTS 70 358 22732800 1800
51190701 4mda4mda D March 11, 2019, 6:01 p.m. OK Java 8 TESTS 70 421 16691200 1800
51262964 Anonymous D March 13, 2019, 2:08 p.m. OK Java 8 TESTS 70 421 39833600 1800
58682320 JCKG D Aug. 12, 2019, 7:41 p.m. OK Java 8 TESTS 70 436 15257600 1800
51229424 Jarik D March 12, 2019, 3:29 p.m. OK Java 8 TESTS 70 451 38912000 1800
51229268 Jarik D March 12, 2019, 3:26 p.m. OK Java 8 TESTS 70 452 41267200 1800
51622962 revanthreddy85 D March 21, 2019, 3:16 p.m. OK Java 8 TESTS 70 483 39116800 1800
51274158 sharepoLOVEDDD D March 13, 2019, 7:47 p.m. OK JavaScript TESTS 70 951 54784000 1800
51603050 yumtam D March 21, 2019, 5:40 a.m. OK Kotlin TESTS 70 1902 94208000 1800
51192770 mircea85 D March 11, 2019, 6:16 p.m. OK Mono C# TESTS 70 374 33587200 1800
51196971 omikad D March 11, 2019, 8:14 p.m. OK Mono C# TESTS 70 529 32153600 1800
54784261 camypaper D May 29, 2019, 2:17 a.m. OK Mono C# TESTS 70 717 33587200 1800
51217407 eki D March 12, 2019, 11:12 a.m. OK Mono C# TESTS 70 1014 77312000 1800
52896148 vjudge1 D April 17, 2019, 8:54 a.m. OK MS C++ TESTS 70 234 11776000 1800
51297176 vjudge5 D March 14, 2019, 12:52 p.m. OK MS C++ TESTS 70 249 11776000 1800
58059745 vjudge4 D July 31, 2019, 6:57 a.m. OK MS C++ TESTS 70 249 11776000 1800
51327522 vjudge3 D March 15, 2019, 10:37 a.m. OK MS C++ TESTS 70 249 11776000 1800
51292277 vjudge5 D March 14, 2019, 11:02 a.m. OK MS C++ TESTS 70 249 11776000 1800
56606422 vjudge5 D July 6, 2019, 4:58 a.m. OK MS C++ TESTS 70 249 11878400 1800
51297430 vjudge5 D March 14, 2019, 12:58 p.m. OK MS C++ TESTS 70 249 11878400 1800
58057005 vjudge5 D July 31, 2019, 5:46 a.m. OK MS C++ TESTS 70 264 16691200 1800
58093859 vjudge3 D July 31, 2019, 6:45 p.m. OK MS C++ TESTS 70 265 16588800 1800
51809299 vjudge3 D March 25, 2019, 3:33 a.m. OK MS C++ TESTS 70 280 5529600 1800
51191429 Ivan11 D March 11, 2019, 6:06 p.m. OK MS C++ 2017 TESTS 70 295 21196800 1800
55009752 Lordxx D June 3, 2019, 9:28 a.m. OK MS C++ 2017 TESTS 70 374 11878400 1800
58062214 vjudge1 D July 31, 2019, 7:48 a.m. OK MS C++ 2017 TESTS 70 374 16588800 1800
53882838 makorro D May 8, 2019, 3:57 p.m. OK MS C++ 2017 TESTS 70 389 7782400 1800
51478246 yp0413170431 D March 19, 2019, 10:12 a.m. OK MS C++ 2017 TESTS 70 389 11776000 1800
51188379 GomBu D March 11, 2019, 5:45 p.m. OK MS C++ 2017 TESTS 70 390 14540800 1800
58101071 vjudge5 D Aug. 1, 2019, 12:53 a.m. OK MS C++ 2017 TESTS 70 405 16588800 1800
51404727 AleksanderBalobanov D March 17, 2019, 9:15 a.m. OK MS C++ 2017 TESTS 70 436 15052800 1800
51305798 petko_mitkov D March 14, 2019, 4:41 p.m. OK MS C++ 2017 TESTS 70 607 67891200 1800
51825464 R99 D March 25, 2019, 1:49 p.m. OK MS C++ 2017 TESTS 70 1013 18227200 1800
51604974 UuuuuxxxOwO D March 21, 2019, 6:53 a.m. OK Perl TESTS 70 1575 139264000 1800
51307818 c1729 D March 14, 2019, 5:42 p.m. OK PyPy 2 TESTS 70 686 65945600 1800
51200347 c1729 D March 11, 2019, 10:16 p.m. OK PyPy 2 TESTS 70 701 67891200 1800
51313860 c1729 D March 14, 2019, 9:31 p.m. OK PyPy 2 TESTS 70 702 66150400 1800
51313761 c1729 D March 14, 2019, 9:26 p.m. OK PyPy 2 TESTS 70 717 65843200 1800
51229847 gatsko D March 12, 2019, 3:41 p.m. OK PyPy 2 TESTS 70 733 72499200 1800
51314080 c1729 D March 14, 2019, 9:44 p.m. OK PyPy 2 TESTS 70 764 66150400 1800
51307859 c1729 D March 14, 2019, 5:43 p.m. OK PyPy 2 TESTS 70 826 67788800 1800
51227396 YESMAths D March 12, 2019, 2:41 p.m. OK PyPy 2 TESTS 70 873 65638400 1800
51199047 pajenegod D March 11, 2019, 9:08 p.m. OK PyPy 2 TESTS 70 1153 98304000 1800
51202157 pajenegod D March 12, 2019, 1:02 a.m. OK PyPy 3 TESTS 70 436 41676800 1800
51824750 Leendertz D March 25, 2019, 1:33 p.m. OK PyPy 3 TESTS 70 452 40857600 1800
51202239 pajenegod D March 12, 2019, 1:09 a.m. OK PyPy 3 TESTS 70 498 34816000 1800
51265020 c1729 D March 13, 2019, 3:06 p.m. OK PyPy 3 TESTS 70 733 67379200 1800
51199195 pajenegod D March 11, 2019, 9:14 p.m. OK PyPy 3 TESTS 70 764 72601600 1800
51263671 pajenegod D March 13, 2019, 2:29 p.m. OK PyPy 3 TESTS 70 1044 102092800 1800
51432307 Stephan D March 18, 2019, 2:18 a.m. OK PyPy 3 TESTS 70 1122 30617600 1800
51245127 Regius D March 13, 2019, 4:11 a.m. OK PyPy 3 TESTS 70 1123 33382400 1800
51301240 IngaleAnkur10 D March 14, 2019, 2:30 p.m. OK PyPy 3 TESTS 70 1200 102195200 1800
52290985 lacrimak D April 4, 2019, 1:37 a.m. OK PyPy 3 TESTS 70 1216 38502400 1800
51264178 c1729 D March 13, 2019, 2:44 p.m. OK Python 2 TESTS 70 1512 63795200 1800
51204141 supachai_pay D March 12, 2019, 3:14 a.m. OK Python 2 TESTS 70 1544 78950400 1800
51264246 c1729 D March 13, 2019, 2:46 p.m. OK Python 3 TESTS 70 1372 67072000 1800
52429589 d_i_m_a D April 6, 2019, 9:26 p.m. OK Python 3 TESTS 70 1481 36147200 1800
51215979 KanhuKeNanu D March 12, 2019, 10:28 a.m. OK Python 3 TESTS 70 1497 35430400 1800
51267134 III_Wolverine_III D March 13, 2019, 4:07 p.m. OK Python 3 TESTS 70 1528 52633600 1800
51256741 prmangal D March 13, 2019, 11:37 a.m. OK Python 3 TESTS 70 1637 35430400 1800
52290938 lacrimak D April 4, 2019, 1:33 a.m. OK Python 3 TESTS 70 1653 41267200 1800
51812636 Maklarenov D March 25, 2019, 7:01 a.m. OK Python 3 TESTS 70 1731 57241600 1800
51812465 sdhd D March 25, 2019, 6:54 a.m. OK Python 3 TESTS 70 1731 57344000 1800
51596083 jonbonto D March 20, 2019, 10:05 p.m. OK Python 3 TESTS 70 1746 64307200 1800
51320011 jelech2018 D March 15, 2019, 5:55 a.m. OK Python 3 TESTS 70 1762 38092800 1800
52432382 alykov D April 7, 2019, 12:21 a.m. OK Rust TESTS 70 467 22016000 1800
52353529 sash0 D April 5, 2019, 3:40 p.m. OK Rust TESTS 70 701 60825600 1800
51621283 kobae964 D March 21, 2019, 2:26 p.m. OK Rust TESTS 70 904 117145600 1800

remove filters

Back to search problems