Codeforces Round 785 (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
1673 Codeforces Round 785 (Div. 2) FINISHED False 7200 85850663 April 30, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3358 ) D Lost Arithmetic Progression PROGRAMMING combinatorics implementation math number theory

B"Long ago, you thought of two finite arithmetic progressions A and B . Then you found out another sequence C containing all elements common to both A and B . It is not hard to see that C is also a finite arithmetic progression. After many years, you forgot what A was but remember B and C . You are, for some reason, determined to find this lost arithmetic progression. Before you begin this eternal search, you want to know how many different finite arithmetic progressions exist which can be your lost progression A . Two arithmetic progressions are considered different if they differ in their first term, common difference or number of terms. It may be possible that there are infinitely many such progressions, in which case you won't even try to look for them! Print -1 in all such cases. Even if there are finite number of them, the answer might be very large. So, you are only interested to find the answer modulo 10^9+7 . The first line of input contains a single integer t ( 1 <= q t <= q 100 ) denoting the number of testcases. The first line of each testcase contains three integers b , q and y ( -10^9 <= q b <= q 10^9 , 1 <= q q <= q 10^9 , 2 <= q y <= q 10^9 ) denoting the first term, common difference and number of terms of B respectively. The second line of each testcase contains three integers c , r and z ( -10^9 <= q c <= q 10^9 , 1 <= q r <= q 10^9 , 2 <= q z <= q 10^9 ) denoting the first term, common difference and number of terms of C respectively. For each testcase, print a single line containing a single integer. If there are infinitely many finite arithmetic progressions which could be your lost progression A , print -1 . Otherwise, print the number of finite arithmetic progressions which could be your lost progression A modulo 10^9+7 . In particular, if there are no such finite arithmetic pr"...

Tutorials

Codeforces Round #785 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
155431593 chro4896 D April 30, 2022, 3:55 p.m. OK GNU C11 TESTS 32 31 819200
155473363 zhouyuheng2009 D May 1, 2022, 4:04 a.m. OK GNU C++14 TESTS 32 15 0
155471402 Leasier D May 1, 2022, 3:20 a.m. OK GNU C++14 TESTS 32 15 0
155470580 adrunkard D May 1, 2022, 3 a.m. OK GNU C++14 TESTS 32 15 0
155470482 PYD D May 1, 2022, 2:58 a.m. OK GNU C++14 TESTS 32 15 0
155467561 cp152 D May 1, 2022, 1:39 a.m. OK GNU C++14 TESTS 32 15 0
155464703 lonely_lovely_ckj D May 1, 2022, 12:03 a.m. OK GNU C++14 TESTS 32 15 0
155464393 NusGhy D April 30, 2022, 11:52 p.m. OK GNU C++14 TESTS 32 15 0
155464185 xuanxuan001 D April 30, 2022, 11:43 p.m. OK GNU C++14 TESTS 32 15 0
155477169 pvzelyyds D May 1, 2022, 5:14 a.m. OK GNU C++14 TESTS 32 15 0
155479036 pattnaikhans D May 1, 2022, 5:41 a.m. OK GNU C++14 TESTS 32 15 0
155480375 evresed D May 1, 2022, 6 a.m. OK GNU C++17 TESTS 32 15 0
155480258 Singlanavya D May 1, 2022, 5:58 a.m. OK GNU C++17 TESTS 32 15 0
155479631 vjudge4 D May 1, 2022, 5:49 a.m. OK GNU C++17 TESTS 32 15 0
155479585 Yamazaki D May 1, 2022, 5:49 a.m. OK GNU C++17 TESTS 32 15 0
155477914 luicosas D May 1, 2022, 5:25 a.m. OK GNU C++17 TESTS 32 15 0
155477022 885377999 D May 1, 2022, 5:12 a.m. OK GNU C++17 TESTS 32 15 0
155476618 marvinthang D May 1, 2022, 5:05 a.m. OK GNU C++17 TESTS 32 15 0
155474942 Venn D May 1, 2022, 4:34 a.m. OK GNU C++17 TESTS 32 15 0
155473183 chinaN0.1 D May 1, 2022, 4 a.m. OK GNU C++17 TESTS 32 15 0
155480416 evresed D May 1, 2022, 6 a.m. OK GNU C++17 TESTS 32 15 0
155473217 wrc D May 1, 2022, 4:01 a.m. OK GNU C++17 (64) TESTS 32 15 0
155469779 Ender32k D May 1, 2022, 2:41 a.m. OK GNU C++17 (64) TESTS 32 15 0
155468342 cjtodl D May 1, 2022, 2:03 a.m. OK GNU C++17 (64) TESTS 32 15 0
155466202 Havoc_01 D May 1, 2022, 12:53 a.m. OK GNU C++17 (64) TESTS 32 15 0
155464235 lovely-ckj D April 30, 2022, 11:45 p.m. OK GNU C++17 (64) TESTS 32 15 0
155463767 tyin D April 30, 2022, 11:27 p.m. OK GNU C++17 (64) TESTS 32 15 0
155460916 tsukiko_tsutsukakushi D April 30, 2022, 9:51 p.m. OK GNU C++17 (64) TESTS 32 15 0
155456617 sergey111 D April 30, 2022, 8:04 p.m. OK GNU C++17 (64) TESTS 32 15 0
155452250 AmeerTaweel D April 30, 2022, 6:41 p.m. OK GNU C++17 (64) TESTS 32 15 0
155477399 border D May 1, 2022, 5:18 a.m. OK GNU C++17 (64) TESTS 32 15 0
155479644 vaibhav.goyal D May 1, 2022, 5:50 a.m. OK GNU C++20 (64) TESTS 32 15 0
155478449 Food_Chain_Rule D May 1, 2022, 5:34 a.m. OK GNU C++20 (64) TESTS 32 15 0
155477982 hunanligong D May 1, 2022, 5:27 a.m. OK GNU C++20 (64) TESTS 32 15 0
155475750 AsindE D May 1, 2022, 4:50 a.m. OK GNU C++20 (64) TESTS 32 15 0
155475442 Followall D May 1, 2022, 4:44 a.m. OK GNU C++20 (64) TESTS 32 15 0
155475287 Saarthak_10 D May 1, 2022, 4:41 a.m. OK GNU C++20 (64) TESTS 32 15 0
155475095 Saarthak_10 D May 1, 2022, 4:37 a.m. OK GNU C++20 (64) TESTS 32 15 0
155475093 _Sunrise_ D May 1, 2022, 4:37 a.m. OK GNU C++20 (64) TESTS 32 15 0
155473992 uaena_mao D May 1, 2022, 4:16 a.m. OK GNU C++20 (64) TESTS 32 15 0
155471130 EDIEEee D May 1, 2022, 3:14 a.m. OK GNU C++20 (64) TESTS 32 15 0
155444990 Omar_Mohammad D April 30, 2022, 5:08 p.m. OK Java 11 TESTS 32 186 0
155468944 I_love_Hermoine_Granger D May 1, 2022, 2:19 a.m. OK Java 11 TESTS 32 187 0
155444451 Restricted D April 30, 2022, 5:03 p.m. OK Java 11 TESTS 32 187 0
155475423 0124getU D May 1, 2022, 4:44 a.m. OK Java 11 TESTS 32 202 0
155456563 def_not_alt D April 30, 2022, 8:03 p.m. OK Java 11 TESTS 32 202 0
155441539 Omar_Mohammad D April 30, 2022, 4:32 p.m. OK Java 11 TESTS 32 202 0
155432298 Cepera D April 30, 2022, 3:57 p.m. OK Java 11 TESTS 32 202 0
155477601 sf14t D May 1, 2022, 5:21 a.m. OK Java 11 TESTS 32 218 0
155431536 earl_of_byteland D April 30, 2022, 3:55 p.m. OK Java 11 TESTS 32 218 0
155439746 profchi D April 30, 2022, 4:26 p.m. OK Java 11 TESTS 32 233 0
155459511 ziduoyi D April 30, 2022, 9:13 p.m. OK Java 8 TESTS 32 124 0
155432978 DumplingLife D April 30, 2022, 4 p.m. OK Java 8 TESTS 32 124 0
155431132 AdhmMohamed D April 30, 2022, 3:53 p.m. OK Java 8 TESTS 32 124 0
155460658 tarattata1 D April 30, 2022, 9:44 p.m. OK MS C++ 2017 TESTS 32 15 0
155444528 Shkiper D April 30, 2022, 5:04 p.m. OK MS C++ 2017 TESTS 32 15 0
155432563 machine_solution D April 30, 2022, 3:58 p.m. OK MS C++ 2017 TESTS 32 30 204800
155439040 ItamarNir D April 30, 2022, 4:24 p.m. OK MS C++ 2017 TESTS 32 46 0
155432193 taiga0629 D April 30, 2022, 3:57 p.m. OK PyPy 3 TESTS 32 124 2048000
155433202 carpenter_bee D April 30, 2022, 4:01 p.m. OK PyPy 3 TESTS 32 140 2560000
155437933 mnkqc D April 30, 2022, 4:19 p.m. OK PyPy 3 TESTS 32 140 2867200
155473619 arpan.parikh D May 1, 2022, 4:07 a.m. OK PyPy 3 TESTS 32 140 5734400
155437104 CodyTheWolf D April 30, 2022, 4:16 p.m. OK PyPy 3 TESTS 32 171 5734400
155448875 Amiy_Tiwari D April 30, 2022, 5:49 p.m. OK PyPy 3 TESTS 32 187 6041600
155455529 felixse D April 30, 2022, 7:40 p.m. OK PyPy 3 TESTS 32 265 10342400
155466959 codingmasterhw D May 1, 2022, 1:19 a.m. OK PyPy 3-64 TESTS 32 92 133120000
155432542 nasuo D April 30, 2022, 3:58 p.m. OK PyPy 3-64 TESTS 32 93 2662400
155443701 Neothehero D April 30, 2022, 4:58 p.m. OK PyPy 3-64 TESTS 32 93 4710400
155437310 _MADARA_ D April 30, 2022, 4:17 p.m. OK PyPy 3-64 TESTS 32 93 4710400
155440968 titia D April 30, 2022, 4:30 p.m. OK PyPy 3-64 TESTS 32 108 2764800
155479983 sakshatmali D May 1, 2022, 5:55 a.m. OK PyPy 3-64 TESTS 32 108 3276800
155448138 mnkqc D April 30, 2022, 5:40 p.m. OK PyPy 3-64 TESTS 32 108 3686400
155433021 plevande D April 30, 2022, 4 p.m. OK PyPy 3-64 TESTS 32 108 4300800
155435852 Vermeil D April 30, 2022, 4:11 p.m. OK PyPy 3-64 TESTS 32 109 4608000
155444094 Neothehero D April 30, 2022, 5 p.m. OK PyPy 3-64 TESTS 32 109 4710400
155439060 apylers D April 30, 2022, 4:24 p.m. OK Python 3 TESTS 32 218 0
155480102 ace_in_night D May 1, 2022, 5:56 a.m. OK Python 3 TESTS 32 342 0
155432939 clause D April 30, 2022, 4 p.m. OK Rust 2021 TESTS 32 15 0
155443482 LittleFall D April 30, 2022, 4:57 p.m. OK Rust 2021 TESTS 32 15 204800

remove filters

Back to search problems