Codeforces Round 784 (Div. 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
1669 Codeforces Round 784 (Div. 4) FINISHED False 7200 86714663 April 21, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18585 ) E 2-Letter Strings PROGRAMMING data structures math strings 1200

B'Given n strings, each of length 2 , consisting of lowercase Latin alphabet letters from 'a ' to 'k ', output the number of pairs of indices (i, j) such that i < j and the i -th string and the j -th string differ in exactly one position. In other words, count the number of pairs (i, j) ( i < j ) such that the i -th string and the j -th string have exactly one position p ( 1 <= q p <= q 2 ) such that {s_{i}}_{p} neq {s_{j}}_{p} . The answer may not fit into 32-bit integer type, so you should use 64-bit integers like long long in C++ to avoid integer overflow. The first line of the input contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 10^5 ) -- the number of strings. Then follows n lines, the i -th of which containing a single string s_i of length 2 , consisting of lowercase Latin letters from 'a ' to 'k '. It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, print a single integer -- the number of pairs (i, j) ( i < j ) such that the i -th string and the j -th string have exactly one position p ( 1 <= q p <= q 2 ) such that {s_{i}}_{p} neq {s_{j}}_{p} . Please note, that the answer for some test cases won 't fit into 32-bit integer type, so you should use at least 64-bit integer type in your programming language (like long long for C++). For the first test case the pairs that differ in exactly one position are: ("ab", "cb"), ("ab", "db"), ("ab", "aa"), ("cb", "db") and ("cb", "cc"). For the second test case the pairs that differ in exactly one position are: ("aa", "ac"), ("aa", "ca"), ("cc", "ac"), ("cc", "ca"), ("ac", "aa") and ("ca", "aa"). For the third test case, the are no pairs satisfying the conditions. '...

Tutorials

102101

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154599806 GTrigger E April 22, 2022, 9:35 p.m. OK GNU C11 TESTS 9 15 307200 1200
154826760 Tiantian2021 E April 24, 2022, 8:31 a.m. OK GNU C++14 TESTS 9 15 0 1200
154770445 PauumSoCutee E April 23, 2022, 5 p.m. OK GNU C++14 TESTS 9 15 0 1200
154756560 dev_2000 E April 23, 2022, 4:09 p.m. OK GNU C++14 TESTS 9 15 0 1200
154641023 diandian2020 E April 23, 2022, 9:41 a.m. OK GNU C++14 TESTS 9 15 0 1200
154633221 adcarryII E April 23, 2022, 8:17 a.m. OK GNU C++14 TESTS 9 15 0 1200
154630468 extcfygvuhbjn E April 23, 2022, 7:42 a.m. OK GNU C++14 TESTS 9 15 0 1200
154629573 extcfygvuhbjn E April 23, 2022, 7:30 a.m. OK GNU C++14 TESTS 9 15 0 1200
154620617 cpp23emotion E April 23, 2022, 5:50 a.m. OK GNU C++14 TESTS 9 15 0 1200
154611221 luogu_bot4 E April 23, 2022, 2:58 a.m. OK GNU C++14 TESTS 9 15 0 1200
154828696 yrz2012 E April 24, 2022, 8:49 a.m. OK GNU C++14 TESTS 9 15 0 1200
154900939 yayi E April 25, 2022, 3:37 a.m. OK GNU C++17 TESTS 9 15 0 1200
154899339 MeEk_0 E April 25, 2022, 3:01 a.m. OK GNU C++17 TESTS 9 15 0 1200
154870360 5120202762 E April 24, 2022, 3:51 p.m. OK GNU C++17 TESTS 9 15 0 1200
154854768 yanhuo12138 E April 24, 2022, 1:12 p.m. OK GNU C++17 TESTS 9 15 0 1200
154848528 AbdelrahmanTarek0.1 E April 24, 2022, 12:13 p.m. OK GNU C++17 TESTS 9 15 0 1200
154838785 world_classic E April 24, 2022, 10:47 a.m. OK GNU C++17 TESTS 9 15 0 1200
154828605 amit_kumar112 E April 24, 2022, 8:48 a.m. OK GNU C++17 TESTS 9 15 0 1200
154803712 ari_haran01 E April 24, 2022, 3:08 a.m. OK GNU C++17 TESTS 9 15 0 1200
154778935 AbylaiNur E April 23, 2022, 6:18 p.m. OK GNU C++17 TESTS 9 15 0 1200
154640187 hilsavani E April 23, 2022, 9:32 a.m. OK GNU C++17 TESTS 9 15 0 1200
154615441 Sparrow. E April 23, 2022, 4:29 a.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154883562 Wielomian E April 24, 2022, 6:57 p.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154861598 Chandraprabhu E April 24, 2022, 2:19 p.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154849987 pd_codes E April 24, 2022, 12:26 p.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154784103 danielvitor23 E April 23, 2022, 7:29 p.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154619177 kevinyang E April 23, 2022, 5:30 a.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154612635 cyclexit E April 23, 2022, 3:30 a.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154596103 ZiadEl-Gafy E April 22, 2022, 8:32 p.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154593611 soelinhtetptn20204 E April 22, 2022, 7:54 p.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154586382 fr200110219102 E April 22, 2022, 6:08 p.m. OK GNU C++17 (64) TESTS 9 15 0 1200
154598273 new_acc E April 22, 2022, 9:06 p.m. OK GNU C++20 (64) TESTS 9 0 0 1200
154891465 basshead2002 E April 24, 2022, 9:26 p.m. OK GNU C++20 (64) TESTS 9 15 0 1200
154888655 Black_nya E April 24, 2022, 8:32 p.m. OK GNU C++20 (64) TESTS 9 15 0 1200
154881668 ranalive.hr E April 24, 2022, 6:25 p.m. OK GNU C++20 (64) TESTS 9 15 0 1200
154878291 KiaraTeAmo E April 24, 2022, 5:33 p.m. OK GNU C++20 (64) TESTS 9 15 0 1200
154877579 bratezz E April 24, 2022, 5:23 p.m. OK GNU C++20 (64) TESTS 9 15 0 1200
154825932 endCoding E April 24, 2022, 8:22 a.m. OK GNU C++20 (64) TESTS 9 15 0 1200
154820968 achvanov E April 24, 2022, 7:26 a.m. OK GNU C++20 (64) TESTS 9 15 0 1200
154786582 Was_Am_WillBeNewbie E April 23, 2022, 8:09 p.m. OK GNU C++20 (64) TESTS 9 15 0 1200
154775973 makrav.io E April 23, 2022, 5:47 p.m. OK GNU C++20 (64) TESTS 9 15 0 1200
154790200 sunaj E April 23, 2022, 9:12 p.m. OK Java 11 TESTS 9 171 0 1200
154492754 liebigbear E April 22, 2022, 11:50 a.m. OK Java 11 TESTS 9 171 0 1200
154881505 rainweep E April 24, 2022, 6:22 p.m. OK Java 11 TESTS 9 186 0 1200
154584455 MAXEURS E April 22, 2022, 5:45 p.m. OK Java 11 TESTS 9 186 0 1200
154570736 SanskarxRawat E April 22, 2022, 4:21 p.m. OK Java 11 TESTS 9 186 204800 1200
154634488 mayank.singh19 E April 23, 2022, 8:32 a.m. OK Java 11 TESTS 9 187 0 1200
154502608 dhruvil8804 E April 22, 2022, 1:31 p.m. OK Java 11 TESTS 9 202 0 1200
154503465 rorito_199 E April 22, 2022, 1:40 p.m. OK Java 11 TESTS 9 202 0 1200
154863080 ytripathi891 E April 24, 2022, 2:36 p.m. OK Java 11 TESTS 9 217 0 1200
154872748 Eslam_Ahmed E April 24, 2022, 4:13 p.m. OK Java 11 TESTS 9 218 0 1200
154499387 Daly105 E April 22, 2022, 12:57 p.m. OK Java 8 TESTS 9 93 0 1200
154612296 Zicode E April 23, 2022, 3:22 a.m. OK Java 8 TESTS 9 108 0 1200
154798228 ssingh0271 E April 24, 2022, 12:43 a.m. OK Java 8 TESTS 9 108 7782400 1200
154496397 Sussykin E April 22, 2022, 12:28 p.m. OK Java 8 TESTS 9 109 0 1200
154837987 enviornment E April 24, 2022, 10:38 a.m. OK Java 8 TESTS 9 124 0 1200
154647539 ak_ankit E April 23, 2022, 10:53 a.m. OK Java 8 TESTS 9 124 0 1200
154503198 govindrajput E April 22, 2022, 1:37 p.m. OK Java 8 TESTS 9 124 0 1200
154592227 VishuTomar E April 22, 2022, 7:32 p.m. OK Java 8 TESTS 9 140 0 1200
154709220 AbdelrahmanFathy E April 23, 2022, 2:22 p.m. OK Java 8 TESTS 9 155 38297600 1200
154631458 haishui250 E April 23, 2022, 7:54 a.m. OK Java 8 TESTS 9 170 0 1200
154840123 ssb9 E April 24, 2022, 11:03 a.m. OK Kotlin 1.4 TESTS 9 140 0 1200
154497279 paparwinthai E April 22, 2022, 12:36 p.m. OK Kotlin 1.6 TESTS 9 234 0 1200
154593052 ZaidDc E April 22, 2022, 7:45 p.m. OK MS C++ 2017 TESTS 9 46 0 1200
154799789 Dakericy E April 24, 2022, 1:31 a.m. OK MS C++ 2017 TESTS 9 46 0 1200
154584991 chyijiun E April 22, 2022, 5:51 p.m. OK MS C++ 2017 TESTS 9 46 0 1200
154615187 RealStarlight E April 23, 2022, 4:24 a.m. OK MS C++ 2017 TESTS 9 62 0 1200
154788536 theinvasian E April 23, 2022, 8:42 p.m. OK MS C++ 2017 TESTS 9 62 0 1200
154787420 bishnoitejaswi E April 23, 2022, 8:23 p.m. OK MS C++ 2017 TESTS 9 62 0 1200
154496756 mikasamikoto E April 22, 2022, 12:32 p.m. OK MS C++ 2017 TESTS 9 62 2457600 1200
154625429 Felisin E April 23, 2022, 6:43 a.m. OK MS C++ 2017 TESTS 9 234 6041600 1200
154655618 Tangerine E April 23, 2022, 12:26 p.m. OK MS C++ 2017 TESTS 9 249 2457600 1200
154652384 edge555 E April 23, 2022, 11:48 a.m. OK .NET Core C# TESTS 9 733 11264000 1200
154498960 Inspired E April 22, 2022, 12:52 p.m. OK Node.js TESTS 9 389 13824000 1200
154631912 seraph14 E April 23, 2022, 8 a.m. OK PyPy 3 TESTS 9 420 16384000 1200
154544274 Anadi E April 22, 2022, 3:21 p.m. OK PyPy 3 TESTS 9 795 8499200 1200
154652738 swapnilsingh421 E April 23, 2022, 11:52 a.m. OK PyPy 3 TESTS 9 795 9625600 1200
154720153 osama_a_rehman E April 23, 2022, 2:37 p.m. OK PyPy 3 TESTS 9 904 9523200 1200
154722907 osama_a_rehman E April 23, 2022, 2:41 p.m. OK PyPy 3 TESTS 9 919 9523200 1200
154507042 worldsaver E April 22, 2022, 2:18 p.m. OK PyPy 3 TESTS 9 982 6860800 1200
154779091 flashwhite E April 23, 2022, 6:20 p.m. OK PyPy 3 TESTS 9 1076 8704000 1200
154608778 EDCTY E April 23, 2022, 1:57 a.m. OK PyPy 3-64 TESTS 9 93 5017600 1200
154499392 Gorzorg E April 22, 2022, 12:57 p.m. OK PyPy 3-64 TESTS 9 109 5427200 1200
154499216 Conjecture34 E April 22, 2022, 12:55 p.m. OK PyPy 3-64 TESTS 9 109 5427200 1200
154789516 acorn11 E April 23, 2022, 8:59 p.m. OK PyPy 3-64 TESTS 9 109 6451200 1200
154492822 Marco_Lau E April 22, 2022, 11:51 a.m. OK PyPy 3-64 TESTS 9 109 6860800 1200
154506180 tushar26427 E April 22, 2022, 2:08 p.m. OK PyPy 3-64 TESTS 9 140 11571200 1200
154668605 HannibalLectar E April 23, 2022, 12:56 p.m. OK PyPy 3-64 TESTS 9 140 12595200 1200
154907023 ikzzi E April 25, 2022, 5:49 a.m. OK PyPy 3-64 TESTS 9 155 16179200 1200
154501952 nitish420 E April 22, 2022, 1:24 p.m. OK PyPy 3-64 TESTS 9 170 7475200 1200
154820092 brimstone E April 24, 2022, 7:17 a.m. OK PyPy 3-64 TESTS 9 218 9420800 1200
154646653 axe98 E April 23, 2022, 10:44 a.m. OK Python 3 TESTS 9 171 8396800 1200
154810937 ramadugula.venkat E April 24, 2022, 5:25 a.m. OK Python 3 TESTS 9 249 0 1200
154613941 hnton211 E April 23, 2022, 3:58 a.m. OK Python 3 TESTS 9 249 0 1200
154651156 noisegain E April 23, 2022, 11:34 a.m. OK Python 3 TESTS 9 249 204800 1200
154585303 coderbd E April 22, 2022, 5:55 p.m. OK Python 3 TESTS 9 249 5939200 1200
154628690 sushanthgrandhi E April 23, 2022, 7:20 a.m. OK Python 3 TESTS 9 280 0 1200
154504188 rr745 E April 22, 2022, 1:47 p.m. OK Python 3 TESTS 9 295 4198400 1200
154599361 bronze_coder E April 22, 2022, 9:26 p.m. OK Python 3 TESTS 9 311 0 1200
154781442 marcis.vijups E April 23, 2022, 6:51 p.m. OK Python 3 TESTS 9 374 0 1200
154777105 kowlad E April 23, 2022, 5:58 p.m. OK Python 3 TESTS 9 420 0 1200
154593367 DeadFox E April 22, 2022, 7:50 p.m. OK Rust 2021 TESTS 9 15 0 1200
154785906 RunGood E April 23, 2022, 7:57 p.m. OK Rust 2021 TESTS 9 15 6553600 1200
154858951 mocobeta E April 24, 2022, 1:53 p.m. OK Rust 2021 TESTS 9 46 1433600 1200
154751501 Hyrulia E April 23, 2022, 3:52 p.m. OK Rust 2021 TESTS 9 1669 4403200 1200
154750977 Hyrulia E April 23, 2022, 3:50 p.m. OK Rust 2021 TESTS 9 1669 4403200 1200

remove filters

Back to search problems