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 |
---|---|---|---|---|---|---|
1765 | 2022-2023 ICPC, NERC, Southern and Volga Russian Regional Contest (Online Mirror, ICPC Rules, Preferably Teams) | FINISHED | False | 18000 | 62277899 | Nov. 27, 2022, 10:35 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1306 ) | H | Hospital Queue | PROGRAMMING | binary search graphs greedy | 2200 |
B"There are n people (numbered from 1 to n ) signed up for a doctor's appointment. The doctor has to choose in which order he will appoint these people. The i -th patient should be appointed among the first p_i people. There are also m restrictions of the following format: the i -th restriction is denoted by two integers (a_i, b_i) and means that the patient with the index a_i should be appointed earlier than the patient with the index b_i . For example, if n = 4 , p = [2, 3, 2, 4] , m = 1 , a = [3] and b = [1] , then the only order of appointment of patients that does not violate the restrictions is [3, 1, 2, 4] . For n =3 , p = [3, 3, 3] , m = 0 , a = [] and b = [] , any order of appointment is valid. For each patient, calculate the minimum position in the order that they can have among all possible orderings that don't violate the restrictions. The first line contains two integers n and m ( 1 <= n <= 2000 ; 0 <= m <= 2000 ). The second line contains n integers p_1, p_2, ... , p_n ( 1 <= p_i <= n ). Then m lines follow. The i -th of them contains two integers a_i and b_i ( 1 <= a_i, b_i <= n ; a_i ne b_i ). All pairs of (a_i, b_i) are distinct (i. xe2 x80 x89e. if i ne j , then either a_i ne a_j , b_i ne b_j , or both). Additional constraint on the input: there is at least one valid order of patients. Print n integers, where i -th integer is equal to the minimum position of i -th patient in the order, among all valid orders. Positions in the order are numbered from 1 to n . In the first example, [3, 1, 2, 4] the only one valid order, so the minimum position of each patient is equal to their position in this order. In the second example, any order is valid, so any patient can be appointed first. In the third example, ther"... |
109642 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
182919481 | hxhhxh tujunbo BARBARIANNNNN | H | Nov. 27, 2022, 2:49 p.m. | OK | GNU C++14 | TESTS | 100 | 46 | 307200 | 2200 | |
182962116 | Mikoto__Misaka | H | Nov. 28, 2022, 2:24 a.m. | OK | GNU C++14 | TESTS | 100 | 46 | 819200 | 2200 | |
182772677 | do_while_true cccllf Crying | H | Nov. 27, 2022, 11:28 a.m. | OK | GNU C++14 | TESTS | 100 | 61 | 16486400 | 2200 | |
182904209 | dreamoon_love_AA A_A_ | H | Nov. 27, 2022, 12:48 p.m. | OK | GNU C++14 | TESTS | 100 | 171 | 29696000 | 2200 | |
182962155 | Mikoto__Misaka | H | Nov. 28, 2022, 2:25 a.m. | OK | GNU C++14 | TESTS | 100 | 452 | 1433600 | 2200 | |
182899108 | MYNAMEISSHARIFUL mahdi.hasnat I_Love_you_Tithi | H | Nov. 27, 2022, 12:12 p.m. | OK | GNU C++14 | TESTS | 100 | 576 | 409600 | 2200 | |
182961332 | ...pluto | H | Nov. 28, 2022, 2:06 a.m. | OK | GNU C++14 | TESTS | 100 | 702 | 512000 | 2200 | |
182833937 | Suffocating Goodbye_XB y0y68 | H | Nov. 27, 2022, 11:55 a.m. | OK | GNU C++14 | TESTS | 100 | 732 | 81408000 | 2200 | |
182904257 | 2018gtyz10 | H | Nov. 27, 2022, 12:49 p.m. | OK | GNU C++14 | TESTS | 100 | 1716 | 409600 | 2200 | |
182915555 | wanghaoze CHENRUIJIE | H | Nov. 27, 2022, 2:16 p.m. | OK | GNU C++14 | TESTS | 100 | 1918 | 307200 | 2200 | |
182909873 | Agreb | H | Nov. 27, 2022, 1:31 p.m. | OK | GNU C++17 | TESTS | 100 | 31 | 307200 | 2200 | |
182903579 | DeadlyPillow | H | Nov. 27, 2022, 12:44 p.m. | OK | GNU C++17 | TESTS | 100 | 31 | 307200 | 2200 | |
182919752 | clonemasteruwu | H | Nov. 27, 2022, 2:51 p.m. | OK | GNU C++17 | TESTS | 100 | 31 | 512000 | 2200 | |
182914746 | jeromah andrei_boaca alin_gb18 | H | Nov. 27, 2022, 2:10 p.m. | OK | GNU C++17 | TESTS | 100 | 31 | 4403200 | 2200 | |
182952114 | Mnesy | H | Nov. 27, 2022, 9:34 p.m. | OK | GNU C++17 | TESTS | 100 | 31 | 12902400 | 2200 | |
182906382 | Jarif_Rahman | H | Nov. 27, 2022, 1:04 p.m. | OK | GNU C++17 | TESTS | 100 | 46 | 307200 | 2200 | |
182913760 | 6host Elias_Obeid HeMoo | H | Nov. 27, 2022, 2:02 p.m. | OK | GNU C++17 | TESTS | 100 | 46 | 16998400 | 2200 | |
182913138 | Blitztage Nisanth Teja-Smart | H | Nov. 27, 2022, 1:57 p.m. | OK | GNU C++17 | TESTS | 100 | 46 | 23244800 | 2200 | |
182899129 | sathu.hebbar rakshith21mohan highboi | H | Nov. 27, 2022, 12:13 p.m. | OK | GNU C++17 | TESTS | 100 | 62 | 1126400 | 2200 | |
182905383 | Turkhuuu | H | Nov. 27, 2022, 12:57 p.m. | OK | GNU C++17 | TESTS | 100 | 93 | 307200 | 2200 | |
182916430 | 275307894a | H | Nov. 27, 2022, 2:23 p.m. | OK | GNU C++17 (64) | TESTS | 100 | 46 | 614400 | 2200 | |
182934816 | YaoBIG | H | Nov. 27, 2022, 5:15 p.m. | OK | GNU C++17 (64) | TESTS | 100 | 62 | 102400 | 2200 | |
182924150 | real_Godot | H | Nov. 27, 2022, 3:31 p.m. | OK | GNU C++17 (64) | TESTS | 100 | 62 | 2355200 | 2200 | |
182912098 | Whimpers omeganot uwuenvy | H | Nov. 27, 2022, 1:49 p.m. | OK | GNU C++17 (64) | TESTS | 100 | 78 | 204800 | 2200 | |
182954101 | over_flow | H | Nov. 27, 2022, 10:16 p.m. | OK | GNU C++17 (64) | TESTS | 100 | 108 | 204800 | 2200 | |
182932272 | zihouzhong | H | Nov. 27, 2022, 4:50 p.m. | OK | GNU C++17 (64) | TESTS | 100 | 109 | 204800 | 2200 | |
182872994 | SSRS_ | H | Nov. 27, 2022, 12:04 p.m. | OK | GNU C++17 (64) | TESTS | 100 | 124 | 204800 | 2200 | |
182899784 | JustNik77 _Stefan_ alexchist | H | Nov. 27, 2022, 12:17 p.m. | OK | GNU C++17 (64) | TESTS | 100 | 171 | 4096000 | 2200 | |
182901420 | Heibor CodigoL reedef | H | Nov. 27, 2022, 12:29 p.m. | OK | GNU C++17 (64) | TESTS | 100 | 202 | 102400 | 2200 | |
182784014 | Mr_Eight He_Ren Qingyu | H | Nov. 27, 2022, 11:45 a.m. | OK | GNU C++17 (64) | TESTS | 100 | 405 | 102400 | 2200 | |
182946979 | Sa3tElSefr | H | Nov. 27, 2022, 8:04 p.m. | OK | GNU C++20 (64) | TESTS | 100 | 31 | 102400 | 2200 | |
182969254 | Nero | H | Nov. 28, 2022, 5:12 a.m. | OK | GNU C++20 (64) | TESTS | 100 | 31 | 204800 | 2200 | |
182902491 | Leonidas | H | Nov. 27, 2022, 12:36 p.m. | OK | GNU C++20 (64) | TESTS | 100 | 31 | 204800 | 2200 | |
182905781 | pp_orange gqh jucason_xu | H | Nov. 27, 2022, 1 p.m. | OK | GNU C++20 (64) | TESTS | 100 | 31 | 409600 | 2200 | |
182916806 | vipjml | H | Nov. 27, 2022, 2:26 p.m. | OK | GNU C++20 (64) | TESTS | 100 | 31 | 819200 | 2200 | |
182769250 | changruinian2020 feecIe6418 gyh20 | H | Nov. 27, 2022, 11:04 a.m. | OK | GNU C++20 (64) | TESTS | 100 | 31 | 16281600 | 2200 | |
182918111 | UshanGhosh Alfeh Aritra741 | H | Nov. 27, 2022, 2:37 p.m. | OK | GNU C++20 (64) | TESTS | 100 | 31 | 16588800 | 2200 | |
182927272 | towrist | H | Nov. 27, 2022, 4 p.m. | OK | GNU C++20 (64) | TESTS | 100 | 46 | 819200 | 2200 | |
182904309 | hellojim SanweiTreap GeZhiyuan | H | Nov. 27, 2022, 12:49 p.m. | OK | GNU C++20 (64) | TESTS | 100 | 93 | 204800 | 2200 | |
182923775 | Basilhijaz UserIsUndefined Satoru | H | Nov. 27, 2022, 3:28 p.m. | OK | GNU C++20 (64) | TESTS | 100 | 109 | 204800 | 2200 | |
182912092 | knightL | H | Nov. 27, 2022, 1:49 p.m. | OK | Java 11 | TESTS | 100 | 1652 | 0 | 2200 | |
182911411 | insert_cool_handle | H | Nov. 27, 2022, 1:43 p.m. | OK | Java 11 | TESTS | 100 | 1871 | 0 | 2200 | |
182912940 | Sudin7362 TfueBiley merlin_ | H | Nov. 27, 2022, 1:55 p.m. | OK | Java 17 | TESTS | 100 | 265 | 1228800 | 2200 | |
182773346 | arvindf232 | H | Nov. 27, 2022, 11:33 a.m. | OK | Kotlin 1.6 | TESTS | 100 | 826 | 102400 | 2200 | |
182909553 | Egor | H | Nov. 27, 2022, 1:29 p.m. | OK | Rust 2021 | TESTS | 100 | 31 | 921600 | 2200 | |
182904134 | CSQ31 Spheniscine | H | Nov. 27, 2022, 12:48 p.m. | OK | Rust 2021 | TESTS | 100 | 2979 | 614400 | 2200 |
Back to search problems