Codeforces Round 606 (Div. 1, based on Technocup 2020 Elimination Round 4)

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
1276 Codeforces Round 606 (Div. 1, based on Technocup 2020 Elimination Round 4) FINISHED False 7200 161117687 Dec. 14, 2019, 11:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5127 ) B Two Fairs PROGRAMMING combinatorics dfs and similar ds graphs 1900

B"There are n cities in Berland and some pairs of them are connected by two-way roads. It is guaranteed that you can pass from any city to any other, moving along the roads. Cities are numerated from 1 to n . Two fairs are currently taking place in Berland -- they are held in two different cities a and b ( 1 <= a, b <= n ; a ne b ). Find the number of pairs of cities x and y ( x ne a, x ne b, y ne a, y ne b ) such that if you go from x to y you will have to go through both fairs (the order of visits doesn't matter). Formally, you need to find the number of pairs of cities x,y such that any path from x to y goes through a and b (in any order). Print the required number of pairs. The order of two cities in a pair does not matter, that is, the pairs (x,y) and (y,x) must be taken into account only once. The first line of the input contains an integer t ( 1 <= t <= 4 cdot10^4 ) -- the number of test cases in the input. Next, t test cases are specified. The first line of each test case contains four integers n , m , a and b ( 4 <= n <= 2 cdot10^5 , n - 1 <= m <= 5 cdot10^5 , 1 <= a,b <= n , a ne b ) -- numbers of cities and roads in Berland and numbers of two cities where fairs are held, respectively. The following m lines contain descriptions of roads between cities. Each of road description contains a pair of integers u_i, v_i ( 1 <= u_i, v_i <= n , u_i ne v_i ) -- numbers of cities connected by the road. Each road is bi-directional and connects two different cities. It is guaranteed that from any city you can pass to any other by roads. There can be more than one road between a pair of cities. The sum of the values of n for all sets of input data in the test does not exceed 2 cdot10^5 . The sum of the values of m for all sets of input data"...

Tutorials

Technocup 2020 — Elimination Round 4 + Codeforces Round 606: Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
66838121 hos.lyric B Dec. 14, 2019, 11:18 a.m. OK D TESTS 42 389 22425600 1900
68059294 rr_ B Jan. 2, 2020, 1:44 a.m. OK D TESTS 43 592 28057600 1900
66887385 LaSWeeG B Dec. 14, 2019, 6:48 p.m. OK FPC TESTS 42 311 18534400 1900
66966054 Contna B Dec. 15, 2019, 11:38 a.m. OK GNU C++11 TESTS 42 61 9113600 1900
66872549 xxxyd B Dec. 14, 2019, 2:04 p.m. OK GNU C++11 TESTS 42 62 9830400 1900
66850067 Fuyuki B Dec. 14, 2019, 11:55 a.m. OK GNU C++11 TESTS 42 62 81817600 1900
66858135 _violet B Dec. 14, 2019, 12:23 p.m. OK GNU C++11 TESTS 42 77 40243200 1900
66853880 JoaoFelix7 B Dec. 14, 2019, 12:07 p.m. OK GNU C++11 TESTS 42 77 81715200 1900
66873096 xxxyd B Dec. 14, 2019, 2:11 p.m. OK GNU C++11 TESTS 42 78 9830400 1900
66846907 Dilute B Dec. 14, 2019, 11:45 a.m. OK GNU C++11 TESTS 42 93 3891200 1900
66845049 zxyhh B Dec. 14, 2019, 11:39 a.m. OK GNU C++11 TESTS 42 93 6758400 1900
66849130 MoQianXue B Dec. 14, 2019, 11:52 a.m. OK GNU C++11 TESTS 42 93 9830400 1900
66974906 M_sea B Dec. 15, 2019, 2:20 p.m. OK GNU C++11 TESTS 42 93 15155200 1900
66839337 Egor B Dec. 14, 2019, 11:21 a.m. OK GNU C++14 TESTS 42 156 6451200 1900
67056285 disangan233 B Dec. 17, 2019, 7 a.m. OK GNU C++14 TESTS 42 187 33894400 1900
66852304 abeker B Dec. 14, 2019, 12:02 p.m. OK GNU C++14 TESTS 42 218 13619200 1900
66854897 Jester B Dec. 14, 2019, 12:11 p.m. OK GNU C++14 TESTS 42 233 2150400 1900
66858453 risujiroh B Dec. 14, 2019, 12:24 p.m. OK GNU C++14 TESTS 42 233 6451200 1900
66878990 hellomath B Dec. 14, 2019, 3:53 p.m. OK GNU C++14 TESTS 42 233 8294400 1900
66850345 gs12117 B Dec. 14, 2019, 11:56 a.m. OK GNU C++14 TESTS 42 233 10649600 1900
66850969 zarathu B Dec. 14, 2019, 11:58 a.m. OK GNU C++14 TESTS 42 234 11878400 1900
67997326 Houbunsha B Dec. 31, 2019, 8:54 a.m. OK GNU C++14 TESTS 43 248 13619200 1900
66841052 ynsm B Dec. 14, 2019, 11:26 a.m. OK GNU C++14 TESTS 42 249 5120000 1900
66847771 Uzumaki_Narutoo B Dec. 14, 2019, 11:48 a.m. OK GNU C++17 TESTS 42 202 8704000 1900
67064028 LowR B Dec. 17, 2019, 10:22 a.m. OK GNU C++17 TESTS 42 218 3993600 1900
66859530 ZXyang B Dec. 14, 2019, 12:28 p.m. OK GNU C++17 TESTS 42 233 5427200 1900
66851887 snuke B Dec. 14, 2019, noon OK GNU C++17 TESTS 42 233 6348800 1900
66846655 matthew99 B Dec. 14, 2019, 11:44 a.m. OK GNU C++17 TESTS 42 233 7065600 1900
68149135 bluefi B Jan. 4, 2020, 6:07 a.m. OK GNU C++17 TESTS 43 233 8294400 1900
66873576 sysulby B Dec. 14, 2019, 2:18 p.m. OK GNU C++17 TESTS 42 233 9113600 1900
66857412 HIR180 B Dec. 14, 2019, 12:20 p.m. OK GNU C++17 TESTS 42 233 14336000 1900
66872704 dreamoon_love_AA B Dec. 14, 2019, 2:06 p.m. OK GNU C++17 TESTS 42 248 16076800 1900
67033666 Monogon B Dec. 16, 2019, 4:40 p.m. OK GNU C++17 TESTS 42 249 1228800 1900
68431364 rohithsajith B Jan. 9, 2020, 7 a.m. OK Java 11 TESTS 43 1045 47308800 1900
66858603 sameep17264 B Dec. 14, 2019, 12:25 p.m. OK Java 11 TESTS 42 1637 252313600 1900
66849751 cwise B Dec. 14, 2019, 11:54 a.m. OK Java 8 TESTS 42 326 85504000 1900
67475983 BaZ_ B Dec. 23, 2019, 2:23 p.m. OK Java 8 TESTS 43 358 44544000 1900
66871957 fetetriste B Dec. 14, 2019, 1:57 p.m. OK Java 8 TESTS 42 374 10240000 1900
66848513 uwi B Dec. 14, 2019, 11:50 a.m. OK Java 8 TESTS 42 577 84070400 1900
66842703 spar5h B Dec. 14, 2019, 11:31 a.m. OK Java 8 TESTS 42 717 51097600 1900
68464546 Megabyte B Jan. 9, 2020, 7:34 p.m. OK Java 8 TESTS 43 857 44646400 1900
69231028 YazanAssaf B Jan. 21, 2020, 9:29 a.m. OK Java 8 TESTS 43 888 43622400 1900
67132727 yaoct B Dec. 18, 2019, 1:30 a.m. OK Java 8 TESTS 42 888 46796800 1900
67419480 vjvjain0 B Dec. 22, 2019, 11:08 a.m. OK Java 8 TESTS 43 966 47001600 1900
66882622 Harpae B Dec. 14, 2019, 5:05 p.m. OK Java 8 TESTS 42 998 161075200 1900
66848398 darnley B Dec. 14, 2019, 11:50 a.m. OK Kotlin TESTS 42 1903 97382400 1900
66889790 darnley B Dec. 14, 2019, 7:53 p.m. OK Kotlin TESTS 42 1918 133427200 1900
68295443 camypaper B Jan. 6, 2020, 2:15 a.m. OK Mono C# TESTS 43 686 80179200 1900
66974275 tomomo2b2 B Dec. 15, 2019, 2:08 p.m. OK Mono C# TESTS 42 1200 64819200 1900
69222128 vjudge1 B Jan. 21, 2020, 5:19 a.m. OK MS C++ TESTS 43 187 11980800 1900
66865213 Apsara B Dec. 14, 2019, 12:51 p.m. OK MS C++ TESTS 42 218 7065600 1900
69257284 vjudge1 B Jan. 21, 2020, 4:01 p.m. OK MS C++ TESTS 43 311 7987200 1900
66854108 math957963 B Dec. 14, 2019, 12:08 p.m. OK MS C++ TESTS 42 358 15872000 1900
67015860 vjudge4 B Dec. 16, 2019, 11:28 a.m. OK MS C++ TESTS 42 374 17203200 1900
69520322 vjudge2 B Jan. 25, 2020, 1:15 p.m. OK MS C++ TESTS 43 1028 14438400 1900
69571908 vjudge1 B Jan. 26, 2020, 2:21 p.m. OK MS C++ TESTS 43 1185 11980800 1900
67542610 scorpiowf B Dec. 24, 2019, 3:34 p.m. OK MS C++ 2017 TESTS 43 327 11776000 1900
68715998 AleksanderBalobanov B Jan. 13, 2020, 2:28 p.m. OK MS C++ 2017 TESTS 43 421 38297600 1900
67551680 wp32pw B Dec. 24, 2019, 4:14 p.m. OK MS C++ 2017 TESTS 43 935 15257600 1900
66845060 nukeykt B Dec. 14, 2019, 11:39 a.m. OK MS C++ 2017 TESTS 42 1060 16793600 1900
68011001 Baharevim B Dec. 31, 2019, 3:47 p.m. OK MS C++ 2017 TESTS 43 1091 14540800 1900
69391529 czyer B Jan. 23, 2020, 4 a.m. OK MS C++ 2017 TESTS 43 2308 12185600 1900
69192881 vjudge2 B Jan. 20, 2020, 2:02 p.m. OK MS C++ 2017 TESTS 43 2370 16281600 1900
69540583 anshuman16423 B Jan. 25, 2020, 9:13 p.m. OK PyPy 2 TESTS 43 1840 54067200 1900
66850833 pineriver B Dec. 14, 2019, 11:57 a.m. OK PyPy 3 TESTS 42 1279 29900800 1900
66839070 titia B Dec. 14, 2019, 11:21 a.m. OK PyPy 3 TESTS 42 1435 27033600 1900
66853315 simamumumumu B Dec. 14, 2019, 12:05 p.m. OK PyPy 3 TESTS 42 1481 14233600 1900
67738551 xiema B Dec. 27, 2019, 4:13 p.m. OK PyPy 3 TESTS 43 2074 71065600 1900
66868258 nagitaosu B Dec. 14, 2019, 1:02 p.m. OK Python 3 TESTS 42 1762 32256000 1900
67409033 19n1900011773 B Dec. 22, 2019, 7:36 a.m. OK Python 3 TESTS 43 2198 73830400 1900
66971399 sruthi_1729 B Dec. 15, 2019, 1:18 p.m. OK Python 3 TESTS 42 2433 80281600 1900
66854919 sansen B Dec. 14, 2019, 12:11 p.m. OK Rust TESTS 42 233 22118400 1900

remove filters

Back to search problems