Codeforces Round 165 (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
269 Codeforces Round 165 (Div. 1) FINISHED False 7200 416673023 Feb. 1, 2013, 3:30 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 118 ) E String Theory PROGRAMMING 3100

Emuskald is an innovative musician and always tries to push the boundaries of music production. Now he has come up with an idea for a revolutionary musical instrument — a rectangular harp. A rectangular harp is a rectangle n × m consisting of n rows and m columns. The rows are numbered 1 to n from top to bottom. Similarly the columns are numbered 1 to m from left to right. String pins are spaced evenly across every side, one per unit. Thus there are n pins on the left and right sides of the harp and m pins on its top and bottom. The harp has exactly n + m different strings, each string connecting two different pins, each on a different side of the harp. Emuskald has ordered his apprentice to construct the first ever rectangular harp. However, he didn't mention that no two strings can cross, otherwise it would be impossible to play the harp. Two strings cross if the segments connecting their pins intersect. To fix the harp, Emuskald can perform operations of two types: pick two different columns and swap their pins on each side of the harp, not changing the pins that connect each string; pick two different rows and swap their pins on each side of the harp, not changing the pins that connect each string; In the following example, he can fix the harp by swapping two columns: Help Emuskald complete his creation and find the permutations how the rows and columns of the harp need to be rearranged, or tell that it is impossible to do so. He can detach and reattach each string to its pins, so the physical layout of the strings doesn't matter. The first line of input contains two space-separated integers numbers n and m ( 1 ≤ n , m ≤ 10 5 ), the height and width of the harp in units. Each of the following n + m lines contains 4 space-separated tokens, describing a single string: two symbols a i , b i and two integer numbers p i , q i . The pair a i , p i describes the first pin, and the pair b i , q i describes the second pin of the string; A pair s , x describes t

Tutorials

Разбор Codeforces Round #165

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3330562 bakabakashyoshyo E March 17, 2013, 1:39 p.m. OK GNU C++ TESTS 70 125 80998400 3100
8532443 pwecar E Nov. 3, 2014, 8:01 a.m. OK GNU C++ TESTS 70 154 16486400 3100
40990240 ReaLNero1 E July 30, 2018, 11:44 p.m. OK GNU C++ TESTS 70 156 16486400 3100
14092704 130705009 E Nov. 5, 2015, 4:26 p.m. OK GNU C++ TESTS 70 186 14438400 3100
8156359 duzfan E Oct. 9, 2014, 1:38 p.m. OK GNU C++ TESTS 70 218 14643200 3100
9568526 SkyDec E Jan. 27, 2015, 5:49 a.m. OK GNU C++ TESTS 70 278 13414400 3100
8171166 wjh720 E Oct. 11, 2014, 5:18 a.m. OK GNU C++ TESTS 70 280 53862400 3100
8377342 jiry_2 E Oct. 24, 2014, 12:26 p.m. OK GNU C++ TESTS 70 280 79155200 3100
9009634 vfleaking E Dec. 7, 2014, 12:44 p.m. OK GNU C++ TESTS 70 312 12902400 3100
29701947 owen_creeper E Aug. 23, 2017, 8:40 a.m. OK GNU C++ TESTS 70 312 33075200 3100
8162635 zhj E Oct. 10, 2014, 5:21 a.m. OK GNU C++0x TESTS 70 310 19763200 3100
3071710 BJIAJL E Feb. 4, 2013, 4:37 p.m. OK GNU C++0x TESTS 70 390 121651200 3100
3134682 MinakoKojima E Feb. 15, 2013, 9:05 p.m. OK GNU C++0x TESTS 70 468 26419200 3100
3134680 MinakoKojima E Feb. 15, 2013, 9:04 p.m. OK GNU C++0x TESTS 70 483 26419200 3100
3134404 MinakoKojima E Feb. 15, 2013, 7:28 p.m. OK GNU C++0x TESTS 70 483 26419200 3100
3134684 MinakoKojima E Feb. 15, 2013, 9:07 p.m. OK GNU C++0x TESTS 70 484 26419200 3100
3134669 MinakoKojima E Feb. 15, 2013, 8:57 p.m. OK GNU C++0x TESTS 70 484 26419200 3100
3134596 MinakoKojima E Feb. 15, 2013, 8:27 p.m. OK GNU C++0x TESTS 70 484 26419200 3100
3134700 MinakoKojima E Feb. 15, 2013, 9:13 p.m. OK GNU C++0x TESTS 70 500 26419200 3100
3134575 MinakoKojima E Feb. 15, 2013, 8:20 p.m. OK GNU C++0x TESTS 70 500 26419200 3100
17129876 freebsdx E April 2, 2016, 12:22 p.m. OK GNU C++11 TESTS 70 218 16691200 3100
14938370 Los_Angelos_Laycurse E Dec. 23, 2015, 12:33 p.m. OK GNU C++11 TESTS 70 342 17612800 3100
57897547 lopare E July 28, 2019, 2:14 p.m. OK GNU C++11 TESTS 70 840 27750400 3100
54500037 WOSHIGEPACHONG2 E May 22, 2019, 8:09 p.m. OK GNU C++11 TESTS 70 842 27750400 3100
57821512 py_ultron E July 26, 2019, 11:42 p.m. OK GNU C++11 TESTS 70 902 27750400 3100
27471237 754986421653 E May 31, 2017, 4:38 p.m. OK GNU C++11 TESTS 70 966 27750400 3100
35856521 ______u______ E March 2, 2018, 8:22 p.m. OK GNU C++11 TESTS 70 1060 29798400 3100
35856245 ______n______ E March 2, 2018, 8:16 p.m. OK GNU C++11 TESTS 70 1060 29798400 3100
35855723 _____i_____ E March 2, 2018, 8:06 p.m. OK GNU C++11 TESTS 70 1060 29798400 3100
35855696 _____k_____ E March 2, 2018, 8:06 p.m. OK GNU C++11 TESTS 70 1060 29798400 3100
38719316 rushcheyo E May 29, 2018, 1:08 p.m. OK GNU C++14 TESTS 70 528 30412800 3100
67273109 ElangBondol E Dec. 20, 2019, 9:07 a.m. OK GNU C++14 TESTS 70 842 27852800 3100
23662058 Ali.Pi E Jan. 9, 2017, 7:52 a.m. OK GNU C++14 TESTS 70 1028 29798400 3100
3065217 ProfessionalProgrammer E Feb. 2, 2013, 6:01 p.m. OK Java 7 TESTS 70 1078 53452800 3100
14938378 Los_Angelos_Laycurse E Dec. 23, 2015, 12:34 p.m. OK MS C++ TESTS 70 404 17612800 3100

remove filters

Back to search problems