Codeforces Round 238 (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
406 Codeforces Round 238 (Div. 1) FINISHED False 7200 336320999 March 22, 2014, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 248 ) E Hamming Triples PROGRAMMING implementation math two pointers 2700

B"Little Chris is having a nightmare. Even in dreams all he thinks about is math. Chris dreams about m binary strings of length n, indexed with numbers from 1 to m. The most horrifying part is that the bits of each string are ordered in either ascending or descending order. For example, Chris could be dreaming about the following 4 strings of length 5: The Hamming distance H(a, xe2 x80 x89b) between two strings a and b of length n is the number of positions at which the corresponding symbols are different. xd0 xa1hris thinks that each three strings with different indices constitute a single triple. Chris's delusion is that he will wake up only if he counts the number of such string triples a, b, c that the sum H(a, xe2 x80 x89b) xe2 x80 x89+ xe2 x80 x89H(b, xe2 x80 x89c) xe2 x80 x89+ xe2 x80 x89H(c, xe2 x80 x89a) is maximal among all the string triples constructed from the dreamed strings. Help Chris wake up from this nightmare! The first line of input contains two space-separated integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109; 3 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105), the length and the number of strings. The next m lines contain the description of the strings. The i-th line contains two space-separated integers si and fi (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89si xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891; 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89fi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n), the description of the string with index i; that means that the first fi bits of the i-th string are equal to si, and the remaining n xe2 x80 x89- xe2 x80 x89fi bits are equal to 1 xe2 x80 x89- xe2 x80 x89si. There can be multiple equal strings in Chris's dream. Output a single integer, the number of such string triples among the given that the sum of the Hamming distances between the strings of the triple is maximal."...

Tutorials

Codeforces Round #238 Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
9302370 zwindstorm E Dec. 30, 2014, 3:24 a.m. OK FPC TESTS 49 46 1638400 2700
7004493 Wasun E July 3, 2014, 1:20 p.m. OK FPC TESTS 49 46 1638400 2700
6116443 Alex_2oo8 E March 22, 2014, 5:29 p.m. OK FPC TESTS 49 62 921600 2700
7062006 SanSiroWaltz E July 11, 2014, 6:34 a.m. OK FPC TESTS 49 62 3584000 2700
6122295 LoneFox E March 23, 2014, 5:28 a.m. OK GNU C++ TESTS 49 31 819200 2700
22289571 Claris E Nov. 17, 2016, 1:37 p.m. OK GNU C++ TESTS 49 31 2252800 2700
36873845 vjudge2 E April 2, 2018, 9:24 a.m. OK GNU C++ TESTS 49 31 4403200 2700
6134894 tworuler E March 25, 2014, 6:21 a.m. OK GNU C++ TESTS 49 46 409600 2700
14019536 130705009 E Nov. 2, 2015, 8:27 a.m. OK GNU C++ TESTS 49 46 614400 2700
6996434 qwer_zcc E July 2, 2014, 9:28 a.m. OK GNU C++ TESTS 49 46 819200 2700
6162086 BSBandme E March 27, 2014, 2:20 p.m. OK GNU C++ TESTS 49 46 819200 2700
6139888 krijgertje E March 25, 2014, 2:57 p.m. OK GNU C++ TESTS 49 46 819200 2700
6121444 kutengine E March 23, 2014, 2:18 a.m. OK GNU C++ TESTS 49 46 819200 2700
6121398 tec E March 23, 2014, 2:01 a.m. OK GNU C++ TESTS 49 46 819200 2700
6132836 Zuza E March 24, 2014, 5:43 p.m. OK GNU C++0x TESTS 49 46 819200 2700
6128174 betaveros E March 24, 2014, 1:57 a.m. OK GNU C++0x TESTS 49 46 1024000 2700
6259290 Fdg E April 4, 2014, 4:43 p.m. OK GNU C++0x TESTS 49 46 1126400 2700
6118523 mislav_bradac E March 22, 2014, 7:44 p.m. OK GNU C++0x TESTS 49 46 1126400 2700
6429968 mruxim E April 20, 2014, 2:07 p.m. OK GNU C++0x TESTS 49 46 3481600 2700
6130479 FancyCoder E March 24, 2014, 11:26 a.m. OK GNU C++0x TESTS 49 61 6963200 2700
6121759 RsEnts E March 23, 2014, 3:35 a.m. OK GNU C++0x TESTS 49 61 22016000 2700
6460384 Archon.JK E April 24, 2014, 1:22 p.m. OK GNU C++0x TESTS 49 62 1024000 2700
6128696 Nakochi E March 24, 2014, 5:16 a.m. OK GNU C++0x TESTS 49 62 1228800 2700
9353594 I_love_Hoang_Yen E Jan. 3, 2015, 2:38 p.m. OK GNU C++0x TESTS 49 62 2457600 2700
15164080 syc1999 E Jan. 3, 2016, 2:52 a.m. OK GNU C++11 TESTS 49 46 614400 2700
45786012 __Ressed__ E Nov. 16, 2018, 1:41 a.m. OK GNU C++11 TESTS 49 46 20070400 2700
12993061 Deltax E Sept. 14, 2015, 7:51 a.m. OK GNU C++11 TESTS 49 61 819200 2700
57891275 lopare E July 28, 2019, 11:55 a.m. OK GNU C++11 TESTS 49 62 409600 2700
57819803 py_ultron E July 26, 2019, 10:09 p.m. OK GNU C++11 TESTS 49 62 409600 2700
20551361 wwyyxx E Sept. 12, 2016, 3:02 p.m. OK GNU C++11 TESTS 49 62 614400 2700
20677144 alex_Harry E Sept. 17, 2016, 9 a.m. OK GNU C++11 TESTS 49 62 1433600 2700
45696813 Pickupwin E Nov. 14, 2018, 4:27 a.m. OK GNU C++11 TESTS 49 62 2662400 2700
17139232 freebsdx E April 3, 2016, 3:50 a.m. OK GNU C++11 TESTS 49 62 2867200 2700
19064820 huantwofat E July 13, 2016, 6:26 a.m. OK GNU C++11 TESTS 49 77 1638400 2700
23657092 Ali.Pi E Jan. 8, 2017, 9:35 p.m. OK GNU C++14 TESTS 49 77 2662400 2700
42904524 Mohinem E Sept. 15, 2018, 10:42 p.m. OK GNU C++14 TESTS 49 78 409600 2700
45542529 aman0456 E Nov. 10, 2018, 8:27 p.m. OK GNU C++14 TESTS 49 78 1945600 2700
36242162 ditoly E March 13, 2018, 8:20 a.m. OK GNU C++14 TESTS 49 78 2969600 2700
31709258 FallDream E Oct. 25, 2017, 12:45 p.m. OK GNU C++14 TESTS 49 78 3584000 2700
38708450 Edgration. E May 29, 2018, 3:37 a.m. OK GNU C++14 TESTS 49 124 3379200 2700
23548643 saliii E Jan. 5, 2017, 6:21 a.m. OK GNU C++14 TESTS 49 296 2969600 2700
57573728 ruo E July 23, 2019, 6:16 a.m. OK GNU C++17 TESTS 49 62 1126400 2700
69280692 xymtxdy E Jan. 22, 2020, 5:45 a.m. OK GNU C++17 TESTS 49 78 6144000 2700
42300017 GCC314 E Aug. 31, 2018, 7 a.m. OK GNU C++17 TESTS 49 93 1331200 2700
58183092 89264270823 E Aug. 2, 2019, 4 p.m. OK GNU C++17 TESTS 49 124 6553600 2700
6299963 BryantMark E April 8, 2014, 7:48 a.m. OK Java 6 TESTS 49 186 512000 2700
6118034 uwi E March 22, 2014, 6:35 p.m. OK Java 7 TESTS 49 124 204800 2700
6124199 net12k44 E March 23, 2014, 10:23 a.m. OK Java 7 TESTS 49 155 102400 2700
11338147 Amr_Hassan E May 28, 2015, 7:32 p.m. OK Java 7 TESTS 49 156 0 2700
6134064 alexey.kasatkin E March 25, 2014, 12:03 a.m. OK Java 7 TESTS 49 156 204800 2700
6124310 net12k44 E March 23, 2014, 10:39 a.m. OK Java 7 TESTS 49 171 102400 2700
6299935 BryantMark E April 8, 2014, 7:42 a.m. OK Java 7 TESTS 49 202 307200 2700
7618024 edorundo E Aug. 29, 2014, 3:03 a.m. OK Java 7 TESTS 49 358 2355200 2700
6117968 mmaxio E March 22, 2014, 6:30 p.m. OK Java 7 TESTS 49 732 204800 2700
6299961 BryantMark E April 8, 2014, 7:47 a.m. OK Java 8 TESTS 49 795 1740800 2700
6122001 tangchuanxin E March 23, 2014, 4:29 a.m. OK MS C++ TESTS 49 46 1228800 2700
6121957 tangchuanxin E March 23, 2014, 4:16 a.m. OK MS C++ TESTS 49 46 1228800 2700
25094016 DEGwer E Feb. 28, 2017, 6:33 a.m. OK MS C++ TESTS 49 124 6451200 2700
6128988 blueseen E March 24, 2014, 6:45 a.m. OK MS C++ TESTS 49 139 20070400 2700
6128966 blueseen E March 24, 2014, 6:41 a.m. OK MS C++ TESTS 49 140 20070400 2700
6366893 galois25 E April 15, 2014, 1:42 p.m. OK MS C++ TESTS 49 156 819200 2700

remove filters

Back to search problems