Educational Codeforces Round 71 (Rated for 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
1207 Educational Codeforces Round 71 (Rated for Div. 2) FINISHED False 7200 165338699 Aug. 22, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6118 ) D Number Of Permutations PROGRAMMING combinatorics 1800

B'You are given a sequence of n pairs of integers: (a_1, b_1), (a_2, b_2), ... , (a_n, b_n) . This sequence is called bad if it is sorted in non-descending order by first elements or if it is sorted in non-descending order by second elements. Otherwise the sequence is good. There are examples of good and bad sequences: Calculate the number of permutations of size n such that after applying this permutation to the sequence s it turns into a good sequence. A permutation p of size n is a sequence p_1, p_2, ... , p_n consisting of n distinct integers from 1 to n ( 1 <= p_i <= n ). If you apply permutation p_1, p_2, ... , p_n to the sequence s_1, s_2, ... , s_n you get the sequence s_{p_1}, s_{p_2}, ... , s_{p_n} . For example, if s = [(1, 2), (1, 3), (2, 3)] and p = [2, 3, 1] then s turns into [(1, 3), (2, 3), (1, 2)] . The first line contains one integer n ( 1 <= n <= 3 cdot 10^5 ). The next n lines contains description of sequence s . The i -th line contains two integers a_i and b_i ( 1 <= a_i, b_i <= n ) -- the first and second elements of i -th pair in the sequence. The sequence s may contain equal elements. Print the number of permutations of size n such that after applying this permutation to the sequence s it turns into a good sequence. Print the answer modulo 998244353 (a prime number). In first test case there are six permutations of size 3 : '...

Tutorials

Educational Codeforces Round 71 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
59323261 Wolf. D Aug. 22, 2019, 7:14 p.m. OK Clang++17 Diagnostics TESTS 26 1107 4608000 1800
59323203 Wolf. D Aug. 22, 2019, 7:13 p.m. OK Clang++17 Diagnostics TESTS 26 1107 6758400 1800
59323287 Wolf. D Aug. 22, 2019, 7:15 p.m. OK Clang++17 Diagnostics TESTS 26 1122 4608000 1800
59333002 wxyww D Aug. 23, 2019, 2:35 a.m. OK GNU C++11 TESTS 26 62 6041600 1800
60299062 TangQX D Sept. 9, 2019, 11:27 a.m. OK GNU C++11 TESTS 26 62 7270400 1800
60777300 wcrkonjac D Sept. 18, 2019, 2:53 p.m. OK GNU C++11 TESTS 26 78 5632000 1800
64794816 disposrestfuIly D Nov. 13, 2019, 12:30 p.m. OK GNU C++11 TESTS 26 78 6041600 1800
59332992 kai586123 D Aug. 23, 2019, 2:35 a.m. OK GNU C++11 TESTS 26 78 7270400 1800
59317168 wannaAC D Aug. 22, 2019, 5:09 p.m. OK GNU C++11 TESTS 26 78 32051200 1800
59645327 AutumnKite D Aug. 29, 2019, 5:22 a.m. OK GNU C++11 TESTS 26 93 3481600 1800
64453839 CLT D Nov. 7, 2019, 8:02 a.m. OK GNU C++11 TESTS 26 93 4300800 1800
66098436 poaspoas D Dec. 1, 2019, 8:11 a.m. OK GNU C++11 TESTS 26 93 4812800 1800
59815561 Dilute D Aug. 31, 2019, 3:10 p.m. OK GNU C++11 TESTS 26 93 4812800 1800
59356809 dtc03012 D Aug. 23, 2019, 1:49 p.m. OK GNU C++14 TESTS 26 155 6963200 1800
59631164 Phoenix1369 D Aug. 28, 2019, 6:11 p.m. OK GNU C++14 TESTS 26 156 6041600 1800
68672695 Heart_Blue D Jan. 12, 2020, 5:23 p.m. OK GNU C++14 TESTS 26 171 4812800 1800
60163718 rdd6584 D Sept. 6, 2019, 10:01 a.m. OK GNU C++14 TESTS 26 171 4812800 1800
59315467 downrainsun D Aug. 22, 2019, 4:50 p.m. OK GNU C++14 TESTS 26 171 6041600 1800
59631433 Phoenix1369 D Aug. 28, 2019, 6:19 p.m. OK GNU C++14 TESTS 26 171 6041600 1800
59448771 HouZAJ D Aug. 25, 2019, 2:26 p.m. OK GNU C++14 TESTS 26 171 6041600 1800
59354709 wangXP D Aug. 23, 2019, 1:06 p.m. OK GNU C++14 TESTS 26 171 7270400 1800
59315282 tredcx D Aug. 22, 2019, 4:48 p.m. OK GNU C++14 TESTS 26 186 6041600 1800
66662519 vjudge3 D Dec. 12, 2019, 5:23 a.m. OK GNU C++14 TESTS 26 186 7270400 1800
59327702 add1ctus D Aug. 22, 2019, 9:55 p.m. OK GNU C++17 TESTS 26 155 9523200 1800
59425241 Iris_Stream D Aug. 25, 2019, 1:46 a.m. OK GNU C++17 TESTS 26 156 13824000 1800
59334549 edenooo D Aug. 23, 2019, 3:43 a.m. OK GNU C++17 TESTS 26 170 8806400 1800
59530263 bibibibi D Aug. 26, 2019, 2:46 p.m. OK GNU C++17 TESTS 26 171 3584000 1800
59318509 arounderstands D Aug. 22, 2019, 5:30 p.m. OK GNU C++17 TESTS 26 171 4812800 1800
59414644 aya_uchida D Aug. 24, 2019, 5:33 p.m. OK GNU C++17 TESTS 26 171 6041600 1800
60162738 vjudge4 D Sept. 6, 2019, 9:36 a.m. OK GNU C++17 TESTS 26 171 6041600 1800
60162734 cjj490168650 D Sept. 6, 2019, 9:36 a.m. OK GNU C++17 TESTS 26 171 6041600 1800
59316267 ema D Aug. 22, 2019, 4:58 p.m. OK GNU C++17 TESTS 26 171 7270400 1800
60058324 rich_and_yuong D Sept. 5, 2019, 5:38 a.m. OK GNU C++17 TESTS 26 186 2457600 1800
59578639 reanimatorzon D Aug. 27, 2019, 3:05 p.m. OK Go TESTS 26 296 17920000 1800
59324522 yutake2000 D Aug. 22, 2019, 7:51 p.m. OK Java 8 TESTS 26 358 36147200 1800
59324946 yutake2000 D Aug. 22, 2019, 8:04 p.m. OK Java 8 TESTS 26 358 36249600 1800
59610187 kostasanemozalis D Aug. 28, 2019, 10:36 a.m. OK Java 8 TESTS 26 389 3993600 1800
59677554 TheDarBear D Aug. 29, 2019, 6:49 p.m. OK Java 8 TESTS 26 404 14131200 1800
59826990 arsh.agarwal18 D Aug. 31, 2019, 8:01 p.m. OK Java 8 TESTS 26 405 4198400 1800
67169385 thisbeit D Dec. 18, 2019, 4:44 p.m. OK Java 8 TESTS 26 451 5427200 1800
59322208 hongquanntct D Aug. 22, 2019, 6:47 p.m. OK Java 8 TESTS 26 452 5836800 1800
59415641 Java D Aug. 24, 2019, 6:04 p.m. OK Java 8 TESTS 26 452 14643200 1800
60288434 uwi D Sept. 9, 2019, 5:05 a.m. OK Java 8 TESTS 26 467 12800000 1800
59323435 jakejase2 D Aug. 22, 2019, 7:19 p.m. OK Java 8 TESTS 26 467 18227200 1800
61826633 Spheniscine D Oct. 4, 2019, 5:03 a.m. OK Kotlin TESTS 26 716 30720000 1800
59633167 yakamoto D Aug. 28, 2019, 7:09 p.m. OK Kotlin TESTS 26 764 37990400 1800
61826097 Spheniscine D Oct. 4, 2019, 4:49 a.m. OK Kotlin TESTS 26 1201 60928000 1800
59414383 SuchDog D Aug. 24, 2019, 5:25 p.m. OK Kotlin TESTS 26 1310 50073600 1800
61048257 Spheniscine D Sept. 22, 2019, 5:28 a.m. OK Kotlin TESTS 26 1419 72396800 1800
59846531 Spheniscine D Sept. 1, 2019, 9:44 a.m. OK Kotlin TESTS 26 1496 90521600 1800
60678325 Spheniscine D Sept. 16, 2019, 1:11 p.m. OK Kotlin TESTS 26 1497 72192000 1800
59338542 Spheniscine D Aug. 23, 2019, 6:26 a.m. OK Kotlin TESTS 26 1793 90828800 1800
59342157 Spheniscine D Aug. 23, 2019, 8:01 a.m. OK Kotlin TESTS 26 1825 94003200 1800
59359729 Tlatoani D Aug. 23, 2019, 2:48 p.m. OK Kotlin TESTS 26 1840 51404800 1800
59383356 og.kostya D Aug. 24, 2019, 4:57 a.m. OK Mono C# TESTS 26 327 8396800 1800
60067672 eki D Sept. 5, 2019, 9:48 a.m. OK Mono C# TESTS 26 888 14848000 1800
59317127 omikad D Aug. 22, 2019, 5:08 p.m. OK Mono C# TESTS 26 982 50688000 1800
59420451 Roka D Aug. 24, 2019, 8:42 p.m. OK Mono C# TESTS 26 1029 101990400 1800
63101490 C20193515_LYX D Oct. 22, 2019, 1 a.m. OK MS C++ TESTS 26 187 3584000 1800
63100802 vjudge5 D Oct. 22, 2019, 12:17 a.m. OK MS C++ TESTS 26 217 4812800 1800
59316044 tarattata1 D Aug. 22, 2019, 4:55 p.m. OK MS C++ TESTS 26 982 33177600 1800
59316973 j2v D Aug. 22, 2019, 5:06 p.m. OK MS C++ 2017 TESTS 26 249 2457600 1800
63101495 vjudge3 D Oct. 22, 2019, 1 a.m. OK MS C++ 2017 TESTS 26 249 3584000 1800
59355760 2462478392 D Aug. 23, 2019, 1:28 p.m. OK MS C++ 2017 TESTS 26 249 4812800 1800
59390972 yyoooo D Aug. 24, 2019, 8:29 a.m. OK MS C++ 2017 TESTS 26 264 7270400 1800
59345047 euqrry D Aug. 23, 2019, 9:18 a.m. OK MS C++ 2017 TESTS 26 265 2457600 1800
59379620 zcb D Aug. 24, 2019, 1:54 a.m. OK MS C++ 2017 TESTS 26 280 9625600 1800
59367705 Ivan11 D Aug. 23, 2019, 5:49 p.m. OK MS C++ 2017 TESTS 26 389 21708800 1800
59344891 TillEnd D Aug. 23, 2019, 9:14 a.m. OK MS C++ 2017 TESTS 26 389 32153600 1800
61851665 Y_is_sunshine D Oct. 4, 2019, 12:53 p.m. OK MS C++ 2017 TESTS 26 529 4812800 1800
59321200 CrashMaster D Aug. 22, 2019, 6:25 p.m. OK MS C++ 2017 TESTS 26 545 2457600 1800
59485792 yumtam D Aug. 25, 2019, 5:40 p.m. OK PyPy 2 TESTS 26 1730 61644800 1800
64771249 juppy D Nov. 12, 2019, 11:57 p.m. OK PyPy 3 TESTS 26 1263 54988800 1800
59333067 erickjohnross D Aug. 23, 2019, 2:39 a.m. OK PyPy 3 TESTS 26 1466 70348800 1800
59392087 petya47 D Aug. 24, 2019, 8:57 a.m. OK PyPy 3 TESTS 26 1684 40755200 1800
59329617 meet29 D Aug. 22, 2019, 11:39 p.m. OK PyPy 3 TESTS 26 1716 47206400 1800
59442263 teexone D Aug. 25, 2019, 11:44 a.m. OK PyPy 3 TESTS 26 1793 50380800 1800
59332714 erickjohnross D Aug. 23, 2019, 2:23 a.m. OK PyPy 3 TESTS 26 1793 58470400 1800
59594246 jacob.brazeal nathantheinventor D Aug. 27, 2019, 11:44 p.m. OK PyPy 3 TESTS 26 1809 67379200 1800
59317243 neterukun D Aug. 22, 2019, 5:10 p.m. OK PyPy 3 TESTS 26 1824 74240000 1800
59323426 FireBird23 D Aug. 22, 2019, 7:18 p.m. OK PyPy 3 TESTS 26 1840 57958400 1800
59332669 erickjohnross D Aug. 23, 2019, 2:21 a.m. OK PyPy 3 TESTS 26 1840 58880000 1800
59346232 anshuman16423 D Aug. 23, 2019, 9:48 a.m. OK Python 2 TESTS 26 1996 34816000 1800
59329519 Alisafe D Aug. 22, 2019, 11:35 p.m. OK Python 3 TESTS 26 1762 42393600 1800
59329478 Alisafe D Aug. 22, 2019, 11:33 p.m. OK Python 3 TESTS 26 1762 100249600 1800
59410815 deadguy D Aug. 24, 2019, 3:46 p.m. OK Python 3 TESTS 26 1824 43110400 1800
59410898 deadguy D Aug. 24, 2019, 3:48 p.m. OK Python 3 TESTS 26 1840 43110400 1800
59510584 NocturneBflat D Aug. 26, 2019, 7:50 a.m. OK Python 3 TESTS 26 1840 74752000 1800
59410665 deadguy D Aug. 24, 2019, 3:42 p.m. OK Python 3 TESTS 26 1856 43110400 1800
59353751 tanon710 D Aug. 23, 2019, 12:46 p.m. OK Python 3 TESTS 26 1856 43110400 1800
59411042 deadguy D Aug. 24, 2019, 3:51 p.m. OK Python 3 TESTS 26 1872 43110400 1800
59353033 tanon710 D Aug. 23, 2019, 12:31 p.m. OK Python 3 TESTS 26 1918 43110400 1800
68852485 Firepaw D Jan. 15, 2020, 9:29 a.m. OK Python 3 TESTS 26 1918 53862400 1800
59397518 Lancern D Aug. 24, 2019, 10:54 a.m. OK Rust TESTS 26 93 4812800 1800
59318920 sansen D Aug. 22, 2019, 5:37 p.m. OK Rust TESTS 26 108 15564800 1800
60699892 bor.is D Sept. 16, 2019, 10:49 p.m. OK Rust TESTS 26 187 7168000 1800
60699906 bor.is D Sept. 16, 2019, 10:50 p.m. OK Rust TESTS 26 217 7270400 1800
59901531 AzureSXY D Sept. 2, 2019, 1:51 p.m. OK Rust TESTS 26 264 9625600 1800
59315492 arzk D Aug. 22, 2019, 4:50 p.m. OK Rust TESTS 26 343 16896000 1800
59327792 ValenKof D Aug. 22, 2019, 10 p.m. OK Rust TESTS 26 374 21708800 1800

remove filters

Back to search problems