Codeforces Round 198 (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
340 Codeforces Round 198 (Div. 2) FINISHED False 7200 353946599 Aug. 30, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2480 ) E Iahub and Permutations PROGRAMMING combinatorics math 2200

B"Iahub is so happy about inventing bubble sort graphs that he's staying all day long at the office and writing permutations. Iahubina is angry that she is no more important for Iahub. When Iahub goes away, Iahubina comes to his office and sabotage his research work. The girl finds an important permutation for the research. The permutation contains n distinct integers a1, a2, ..., an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). She replaces some of permutation elements with -1 value as a revenge. When Iahub finds out his important permutation is broken, he tries to recover it. The only thing he remembers about the permutation is it didn't have any fixed point. A fixed point for a permutation is an element ak which has value equal to k (ak xe2 x80 x89= xe2 x80 x89k). Your job is to proof to Iahub that trying to recover it is not a good idea. Output the number of permutations which could be originally Iahub's important permutation, modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). The first line contains integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892000). On the second line, there are n integers, representing Iahub's important permutation after Iahubina replaces some values with -1. It's guaranteed that there are no fixed points in the given permutation. Also, the given sequence contains at least two numbers -1 and each positive number occurs in the sequence at most once. It's guaranteed that there is at least one suitable permutation. Output a single integer, the number of ways Iahub could recover his permutation, modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). For the first test example there are two permutations with no fixed points are [2, 5, 4, 3, 1] and [5, 1, 4, 3, 2]. Any other permutation would have at least one fixed point. "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
4416230 asdsteven2 E Sept. 7, 2013, 12:27 a.m. OK D TESTS 18 0 102400 2200
4413497 _piyush E Sept. 6, 2013, 7:23 a.m. OK Delphi TESTS 18 592 144384000 2200
40759391 luogu_bot4 E July 26, 2018, 2:23 a.m. OK FPC TESTS 18 62 0 2200
40759378 vjudge5 E July 26, 2018, 2:22 a.m. OK FPC TESTS 18 62 0 2200
5566658 zhzq123 E Dec. 30, 2013, 5:53 a.m. OK FPC TESTS 18 92 32153600 2200
4415222 PeterTong97 E Sept. 6, 2013, 3:53 p.m. OK FPC TESTS 18 124 32153600 2200
4387163 Nik_Storm_2010 E Aug. 31, 2013, 10:47 a.m. OK FPC TESTS 18 124 32153600 2200
4391833 pal3 E Sept. 1, 2013, 8:18 a.m. OK FPC TESTS 18 280 32051200 2200
4409393 crazykt E Sept. 5, 2013, 11:44 a.m. OK GNU C TESTS 18 30 0 2200
4395067 _vip3_ E Sept. 1, 2013, 11:24 p.m. OK GNU C TESTS 18 62 32153600 2200
17998908 bossam6170 E May 20, 2016, 2:59 a.m. OK GNU C TESTS 18 62 34201600 2200
5291193 VishalTheBEAST E Nov. 29, 2013, 4:22 a.m. OK GNU C TESTS 18 92 32256000 2200
4401874 ikbal E Sept. 3, 2013, 2:56 p.m. OK GNU C TESTS 18 124 32358400 2200
4385563 svsfzhc E Aug. 31, 2013, 5:15 a.m. OK GNU C TESTS 18 156 102400 2200
4391515 TanyaAdams E Sept. 1, 2013, 6:29 a.m. OK GNU C++ TESTS 18 0 102400 2200
4486397 leiou E Sept. 17, 2013, 4:07 a.m. OK GNU C++ TESTS 18 15 0 2200
42258438 vjudge5 E Aug. 30, 2018, 12:34 a.m. OK GNU C++ TESTS 18 30 0 2200
41578905 vjudge3 E Aug. 14, 2018, 6:58 a.m. OK GNU C++ TESTS 18 30 0 2200
30776682 vjudge1 E Sept. 27, 2017, 12:32 p.m. OK GNU C++ TESTS 18 30 0 2200
30666334 vjudge4 E Sept. 24, 2017, 12:56 p.m. OK GNU C++ TESTS 18 30 0 2200
30665884 vjudge2 E Sept. 24, 2017, 12:34 p.m. OK GNU C++ TESTS 18 30 0 2200
30627285 vjudge4 E Sept. 23, 2017, 12:04 a.m. OK GNU C++ TESTS 18 30 0 2200
30626863 vjudge2 E Sept. 22, 2017, 11:11 p.m. OK GNU C++ TESTS 18 30 0 2200
30626861 __Apocrypha E Sept. 22, 2017, 11:10 p.m. OK GNU C++ TESTS 18 30 0 2200
5343931 xorfire E Dec. 3, 2013, 4:44 p.m. OK GNU C++0x TESTS 18 30 0 2200
4510377 fengzlzl E Sept. 20, 2013, 2:09 p.m. OK GNU C++0x TESTS 18 30 0 2200
4409582 andreihh E Sept. 5, 2013, 12:37 p.m. OK GNU C++0x TESTS 18 30 0 2200
4399705 2011330300713 E Sept. 3, 2013, 4:41 a.m. OK GNU C++0x TESTS 18 30 0 2200
4396755 Mark_Fan E Sept. 2, 2013, 11:38 a.m. OK GNU C++0x TESTS 18 30 102400 2200
8468768 EarlOfDitches E Oct. 29, 2014, 12:07 p.m. OK GNU C++0x TESTS 18 30 2150400 2200
9393170 BogdanFlorea E Jan. 9, 2015, 4:40 p.m. OK GNU C++0x TESTS 18 30 16281600 2200
4380126 molamola. E Aug. 30, 2013, 5:05 p.m. OK GNU C++0x TESTS 18 30 16384000 2200
4428151 dexctor E Sept. 7, 2013, 2:04 p.m. OK GNU C++0x TESTS 18 30 32358400 2200
4529237 cylixstar E Sept. 21, 2013, 9:52 a.m. OK GNU C++0x TESTS 18 62 16076800 2200
58548243 The.Last.Wizard E Aug. 10, 2019, 6 p.m. OK GNU C++11 TESTS 18 30 0 2200
41137035 Omar_Elawady E Aug. 2, 2018, 9:59 p.m. OK GNU C++11 TESTS 18 30 0 2200
30545221 yzf E Sept. 20, 2017, 12:40 p.m. OK GNU C++11 TESTS 18 30 0 2200
30375177 Ahmed_Morsy E Sept. 16, 2017, 2:47 a.m. OK GNU C++11 TESTS 18 30 0 2200
30298744 helio E Sept. 13, 2017, 4:01 a.m. OK GNU C++11 TESTS 18 30 0 2200
30298721 helio E Sept. 13, 2017, 3:59 a.m. OK GNU C++11 TESTS 18 30 0 2200
21908219 shubham1100 E Oct. 31, 2016, 9:46 a.m. OK GNU C++11 TESTS 18 30 0 2200
17281844 apoorv_kulsh E April 11, 2016, 6:06 p.m. OK GNU C++11 TESTS 18 30 0 2200
15415418 bciobanu E Jan. 17, 2016, 1:49 p.m. OK GNU C++11 TESTS 18 30 0 2200
14321521 fengsuiyan E Nov. 18, 2015, 6:34 a.m. OK GNU C++11 TESTS 18 30 0 2200
39736873 Heart_Blue E June 28, 2018, 8:28 a.m. OK GNU C++14 TESTS 18 30 0 2200
27824668 hzcong E June 16, 2017, 12:21 p.m. OK GNU C++14 TESTS 18 30 0 2200
69597368 face4 E Jan. 27, 2020, 5:39 a.m. OK GNU C++14 TESTS 18 30 102400 2200
44285304 Samaritan123 E Oct. 14, 2018, 7:09 a.m. OK GNU C++14 TESTS 18 30 102400 2200
43224829 vntshh E Sept. 21, 2018, 8:25 p.m. OK GNU C++14 TESTS 18 30 102400 2200
30659552 Fuko_Ibuki E Sept. 24, 2017, 7:54 a.m. OK GNU C++14 TESTS 18 30 102400 2200
31707601 blue__legend E Oct. 25, 2017, 11:50 a.m. OK GNU C++14 TESTS 18 30 307200 2200
54066395 zstu_MingSD E May 13, 2019, 1:42 p.m. OK GNU C++14 TESTS 18 30 1638400 2200
24111071 AshishYadav E Jan. 25, 2017, 12:29 p.m. OK GNU C++14 TESTS 18 30 1945600 2200
26300498 baili0411 E April 11, 2017, 1:55 p.m. OK GNU C++14 TESTS 18 30 2048000 2200
47165395 MonogatariKoi E Dec. 17, 2018, 12:16 p.m. OK GNU C++17 TESTS 18 30 0 2200
62205129 Leafy_ E Oct. 9, 2019, 1:01 p.m. OK GNU C++17 TESTS 18 30 102400 2200
50067920 roll_no_1 E Feb. 17, 2019, 3:52 p.m. OK GNU C++17 TESTS 18 30 102400 2200
57307105 Ajax E July 19, 2019, 4:37 a.m. OK GNU C++17 TESTS 18 30 307200 2200
42802912 Mr_leon E Sept. 12, 2018, 3:24 p.m. OK GNU C++17 TESTS 18 30 512000 2200
47030520 sys. E Dec. 15, 2018, 9:29 a.m. OK GNU C++17 TESTS 18 30 84172800 2200
40732529 vjudge1 E July 25, 2018, 8:17 a.m. OK GNU C++17 TESTS 18 60 0 2200
50273597 Lucina E Feb. 21, 2019, 8:42 a.m. OK GNU C++17 TESTS 18 60 102400 2200
50041091 aakk E Feb. 17, 2019, 1:57 a.m. OK GNU C++17 TESTS 18 60 102400 2200
40739071 qinyuyang E July 25, 2018, 11:23 a.m. OK GNU C++17 TESTS 18 60 102400 2200
54744019 Phantasm E May 28, 2019, 9:35 a.m. OK Go TESTS 18 92 36454400 2200
13515813 behzad.nouri E Oct. 9, 2015, 6:45 p.m. OK Haskell TESTS 18 60 0 2200
4384065 mkirsche E Aug. 30, 2013, 7:59 p.m. OK Java 6 TESTS 18 156 0 2200
4406811 llaki E Sept. 4, 2013, 8:25 p.m. OK Java 6 TESTS 18 218 53145600 2200
4398425 alibaba E Sept. 2, 2013, 5:55 p.m. OK Java 6 TESTS 18 280 20582400 2200
4411274 nishchay2192 E Sept. 5, 2013, 1:40 p.m. OK Java 6 TESTS 18 280 52940800 2200
4501161 Phicar E Sept. 19, 2013, 5:42 a.m. OK Java 6 TESTS 18 280 55296000 2200
4448222 udontknowme E Sept. 12, 2013, 1:36 p.m. OK Java 6 TESTS 18 374 71680000 2200
4448231 udontknowme E Sept. 12, 2013, 1:38 p.m. OK Java 6 TESTS 18 404 71680000 2200
4390707 yimocool E Sept. 1, 2013, 12:52 a.m. OK Java 7 TESTS 18 156 13516800 2200
4429579 vadimmm E Sept. 7, 2013, 8:19 p.m. OK Java 7 TESTS 18 186 13619200 2200
4412837 aste E Sept. 6, 2013, 12:42 a.m. OK Java 7 TESTS 18 218 102400 2200
4399037 ericxu0 E Sept. 2, 2013, 10:17 p.m. OK Java 7 TESTS 18 218 102400 2200
4395013 Zyflair E Sept. 1, 2013, 10:53 p.m. OK Java 7 TESTS 18 218 102400 2200
4383735 DoublePointer E Aug. 30, 2013, 7:13 p.m. OK Java 7 TESTS 18 218 51404800 2200
4395506 ffao E Sept. 2, 2013, 4:32 a.m. OK Java 7 TESTS 18 218 51916800 2200
4390405 JMS E Aug. 31, 2013, 9:46 p.m. OK Java 7 TESTS 18 218 51916800 2200
4565517 AlexanderBolshakov E Sept. 26, 2013, 6:35 a.m. OK Java 7 TESTS 18 248 53555200 2200
9492249 sweiss E Jan. 21, 2015, 12:11 p.m. OK Java 7 TESTS 18 280 13926400 2200
61287728 ISSAM_LAKOUAM E Sept. 25, 2019, 7:09 p.m. OK Java 8 TESTS 18 248 0 2200
10512327 vjudge5 E March 29, 2015, 7:29 a.m. OK Java 8 TESTS 18 248 0 2200
45203220 schwarzahl E Nov. 2, 2018, 11:18 a.m. OK Java 8 TESTS 18 280 0 2200
25569234 Slamur E March 17, 2017, 10:37 a.m. OK Java 8 TESTS 18 310 61337600 2200
40604710 amnesiac_dusk E July 21, 2018, 10:41 a.m. OK Java 8 TESTS 18 342 37990400 2200
32953888 MazzForces E Dec. 5, 2017, 4:54 p.m. OK Java 8 TESTS 18 342 61747200 2200
60286602 satya26 E Sept. 9, 2019, 3:08 a.m. OK Java 8 TESTS 18 466 0 2200
25569098 Slamur E March 17, 2017, 10:30 a.m. OK Java 8 TESTS 18 498 61337600 2200
60286480 satya26 E Sept. 9, 2019, 3:01 a.m. OK Java 8 TESTS 18 590 38912000 2200
66141160 pulkit1411 E Dec. 1, 2019, 2:27 p.m. OK Java 8 TESTS 18 622 0 2200
4389531 rubengt01 E Aug. 31, 2013, 6:08 p.m. OK MS C# TESTS 18 62 32768000 2200
4389537 rubengt01 E Aug. 31, 2013, 6:09 p.m. OK MS C# TESTS 18 92 32870400 2200
10364870 not_antony E March 20, 2015, 10:18 a.m. OK MS C++ TESTS 18 30 102400 2200
10368690 chiyar E March 20, 2015, 3:59 p.m. OK MS C++ TESTS 18 30 204800 2200
4383654 Reshetnikov_Ivan E Aug. 30, 2013, 7:04 p.m. OK MS C++ TESTS 18 30 921600 2200
10364789 MrKaStep E March 20, 2015, 10:09 a.m. OK MS C++ TESTS 18 30 5734400 2200
5489878 khayyam E Dec. 22, 2013, 2:37 a.m. OK MS C++ TESTS 18 30 32153600 2200
4387183 Elun E Aug. 31, 2013, 10:49 a.m. OK MS C++ TESTS 18 30 32256000 2200
4387152 Elun E Aug. 31, 2013, 10:45 a.m. OK MS C++ TESTS 18 30 32256000 2200
4388083 Kazim E Aug. 31, 2013, 1:31 p.m. OK MS C++ TESTS 18 30 32358400 2200
4388543 Silent_coder E Aug. 31, 2013, 2:49 p.m. OK MS C++ TESTS 18 30 37785600 2200
58433276 vjudge2 E Aug. 7, 2019, 12:46 p.m. OK MS C++ TESTS 18 62 0 2200
4394113 nab E Sept. 1, 2013, 4:47 p.m. OK Python 2 TESTS 18 62 307200 2200
35860814 ______u______ E March 2, 2018, 9:49 p.m. OK Python 2 TESTS 18 124 4608000 2200
35860629 ______n______ E March 2, 2018, 9:45 p.m. OK Python 2 TESTS 18 124 4608000 2200
35860196 _____i_____ E March 2, 2018, 9:36 p.m. OK Python 2 TESTS 18 124 4608000 2200
35860135 _____k_____ E March 2, 2018, 9:34 p.m. OK Python 2 TESTS 18 124 4608000 2200
35856797 ______h______ E March 2, 2018, 8:27 p.m. OK Python 2 TESTS 18 124 4608000 2200
35856794 ______k______ E March 2, 2018, 8:27 p.m. OK Python 2 TESTS 18 124 4608000 2200
35856158 ______i______ E March 2, 2018, 8:15 p.m. OK Python 2 TESTS 18 124 4608000 2200
35854212 ______M______ E March 2, 2018, 7:38 p.m. OK Python 2 TESTS 18 124 4608000 2200
34497160 yugle7 E Jan. 23, 2018, 9:42 p.m. OK Python 3 TESTS 18 248 5632000 2200
19846797 belovedeagle E Aug. 13, 2016, 9:28 a.m. OK Rust TESTS 18 30 1638400 2200

remove filters

Back to search problems