Codeforces Round 954 (Div. 3)

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
1986 Codeforces Round 954 (Div. 3) FINISHED False 8100 18025763 June 23, 2024, 2:50 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1558 ) G1 Permutation Problem (Simple Version) PROGRAMMING brute force combinatorics math number theory

B'This is a simple version of the problem. The only difference is that in this version n <= q 10^5 and the sum of n for all sets of input data does not exceed 10^5 . You are given a permutation p of length n . Calculate the number of index pairs 1 <= q i < j <= q n such that p_i cdot p_j is divisible by i cdot j without remainder. A permutation is a sequence of n integers, where each integer from 1 to n occurs exactly once. For example, [1] , [3,5,2,1,4] , [1,3,2] are permutations, while [2,3,2] , [4,3,1] , [0] are not. Each test consists of multiple sets of input data. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of sets of input data. Then follows their description. The first line of each set of input data contains a single integer n ( 1 <= q n <= q 10^5 ) -- the length of the permutation p . The second line of each set of input data contains n distinct integers p_1, p_2, ldots, p_n ( 1 <= q p_i <= q n ) -- the permutation p . It is guaranteed that the sum of n for all sets of input data does not exceed 10^5 . For each set of input data, output the number of index pairs 1 <= q i < j <= q n such that p_i cdot p_j is divisible by i cdot j without remainder. In the first set of input data, there are no index pairs, as the size of the permutation is 1 . In the second set of input data, there is one index pair (1, 2) and it is valid. In the third set of input data, the index pair (1, 2) is valid. In the fourth set of input data, the index pairs (1, 2) , (1, 5) , and (2, 5) are valid. '...

Tutorials

130762

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
267127859 4977 G1 June 24, 2024, 4:57 a.m. OK C++14 (GCC 6-32) TESTS 43 749 66560000
267079509 luckyzfy G1 June 23, 2024, 5:12 p.m. OK C++14 (GCC 6-32) TESTS 42 796 64512000
267132188 seanlsy G1 June 24, 2024, 5:49 a.m. OK C++14 (GCC 6-32) TESTS 43 796 84480000
267131813 heaksicn G1 June 24, 2024, 5:44 a.m. OK C++14 (GCC 6-32) TESTS 43 874 108441600
267112750 Wuyanru G1 June 24, 2024, 12:58 a.m. OK C++14 (GCC 6-32) TESTS 43 906 101888000
267112370 Junz_LJL G1 June 24, 2024, 12:50 a.m. OK C++14 (GCC 6-32) TESTS 43 999 111411200
267104193 KIRIJIJI G1 June 23, 2024, 9:46 p.m. OK C++14 (GCC 6-32) TESTS 43 1108 92979200
267126777 GB11 G1 June 24, 2024, 4:42 a.m. OK C++14 (GCC 6-32) TESTS 43 1265 102502400
267087360 xin_chen G1 June 23, 2024, 6:08 p.m. OK C++14 (GCC 6-32) TESTS 42 1499 120832000
267088360 temporary1 G1 June 23, 2024, 6:17 p.m. OK C++17 (GCC 7-32) TESTS 42 124 18841600
267097188 Dimitrovsd G1 June 23, 2024, 7:58 p.m. OK C++17 (GCC 7-32) TESTS 42 140 2457600
267104674 delwar_03_ G1 June 23, 2024, 9:55 p.m. OK C++17 (GCC 7-32) TESTS 43 155 4505600
267099110 ilyaytrewq G1 June 23, 2024, 8:23 p.m. OK C++17 (GCC 7-32) TESTS 42 202 819200
267085864 Fysty G1 June 23, 2024, 5:56 p.m. OK C++17 (GCC 7-32) TESTS 42 202 10854400
267105096 yuan-shen G1 June 23, 2024, 10:03 p.m. OK C++17 (GCC 7-32) TESTS 43 202 11366400
267121101 cow23 G1 June 24, 2024, 3:31 a.m. OK C++17 (GCC 7-32) TESTS 43 203 26112000
267121725 Ansori G1 June 24, 2024, 3:40 a.m. OK C++17 (GCC 7-32) TESTS 43 249 9932800
267105176 jhorvat G1 June 23, 2024, 10:04 p.m. OK C++17 (GCC 7-32) TESTS 43 250 11776000
267131431 namsee1 G1 June 24, 2024, 5:40 a.m. OK C++17 (GCC 7-32) TESTS 43 280 20480000
267097919 bye__bye G1 June 23, 2024, 8:07 p.m. OK C++20 (GCC 13-64) TESTS 42 156 16076800
267086258 Abook G1 June 23, 2024, 5:59 p.m. OK C++20 (GCC 13-64) TESTS 42 202 7270400
267087675 wishgoodluck G1 June 23, 2024, 6:10 p.m. OK C++20 (GCC 13-64) TESTS 42 202 28057600
267080389 sunboi G1 June 23, 2024, 5:16 p.m. OK C++20 (GCC 13-64) TESTS 42 203 4812800
267093140 diobrando97 G1 June 23, 2024, 7:07 p.m. OK C++20 (GCC 13-64) TESTS 42 218 4915200
267112477 goats_9 G1 June 24, 2024, 12:52 a.m. OK C++20 (GCC 13-64) TESTS 43 218 5017600
267088303 Huangyf G1 June 23, 2024, 6:16 p.m. OK C++20 (GCC 13-64) TESTS 42 218 15667200
267082940 dyktr_06 G1 June 23, 2024, 5:32 p.m. OK C++20 (GCC 13-64) TESTS 42 218 16691200
267131764 Sung.An G1 June 24, 2024, 5:44 a.m. OK C++20 (GCC 13-64) TESTS 43 218 17510400
267129059 coderdhanraj G1 June 24, 2024, 5:12 a.m. OK C++20 (GCC 13-64) TESTS 43 218 19046400
267081641 dzhi G1 June 23, 2024, 5:24 p.m. OK Java 21 TESTS 42 1124 97177600
267081179 dzhi G1 June 23, 2024, 5:21 p.m. OK Java 21 TESTS 42 1359 126976000
267103529 profchi G1 June 23, 2024, 9:34 p.m. OK Java 8 TESTS 43 999 101990400
267104455 profchi G1 June 23, 2024, 9:51 p.m. OK Java 8 TESTS 43 1202 131584000
267107179 profchi G1 June 23, 2024, 10:45 p.m. OK Java 8 TESTS 43 1530 131686400
267090480 34z12000 G1 June 23, 2024, 6:37 p.m. OK PyPy 3 TESTS 42 1062 77926400
267090417 34z12000 G1 June 23, 2024, 6:36 p.m. OK PyPy 3 TESTS 42 1077 78028800
267111528 KingofCSES G1 June 24, 2024, 12:28 a.m. OK PyPy 3 TESTS 43 1639 105369600
267108197 helli5.tech G1 June 23, 2024, 11:07 p.m. OK PyPy 3-64 TESTS 43 405 23040000
267097894 samoylovboris G1 June 23, 2024, 8:07 p.m. OK PyPy 3-64 TESTS 42 499 45465600
267097875 misorin G1 June 23, 2024, 8:06 p.m. OK PyPy 3-64 TESTS 42 515 26009600
267096085 samoylovboris G1 June 23, 2024, 7:43 p.m. OK PyPy 3-64 TESTS 42 749 81100800
267076900 misorin G1 June 23, 2024, 5:03 p.m. OK PyPy 3-64 TESTS 42 796 61337600
267125968 PROELECTRO444 G1 June 24, 2024, 4:33 a.m. OK PyPy 3-64 TESTS 43 796 80691200
267078406 CinaDor G1 June 23, 2024, 5:07 p.m. OK PyPy 3-64 TESTS 42 827 49152000
267128647 pronightmare12 G1 June 24, 2024, 5:07 a.m. OK PyPy 3-64 TESTS 43 843 66969600
267125171 PROELECTRO444 G1 June 24, 2024, 4:24 a.m. OK PyPy 3-64 TESTS 43 858 86732800
267077052 Kushagra_2709 G1 June 23, 2024, 5:03 p.m. OK PyPy 3-64 TESTS 42 968 65843200

remove filters

Back to search problems