Codeforces Round 814 (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
1718 Codeforces Round 814 (Div. 1) FINISHED False 7200 76605863 Aug. 16, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 165 ) F Burenka, an Array and Queries PROGRAMMING data structures math number theory

B"Eugene got Burenka an array a of length n of integers from 1 to m for her birthday. Burenka knows that Eugene really likes coprime integers (integers x and y such that they have only one common factor (equal to 1 )) so she wants to to ask Eugene q questions about the present. Each time Burenka will choose a subsegment a_l, a_{l + 1}, ldots, a_r of array a , and compute the product of these numbers p = a_l cdot a_{l + 1} cdot ldots cdot a_r . Then she will ask Eugene to count the number of integers between 1 and C inclusive which are coprime with p . Help Eugene answer all the questions! In the first line of input there are four integers n , m , C , q ( 1 <= q n, q <= q 10^5 , 1 <= q m <= q 2 cdot 10^4 , 1 <= q C <= q 10^5 ) -- the length of the array a , the maximum possible value of a_{i} , the value C , and the number of queries. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_{i} <= q m ) -- the array a . In the next q lines the queries are given. Each query consists of two integers l and r ( 1 <= q l <= q r <= q n ). Print q integers -- the answers to Burenka's queries. Here's an explanation for the example: "...

Tutorials

Codeforces Round #814 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
168629974 Expert_0_ F Aug. 16, 2022, 10:21 p.m. OK GNU C++17 TESTS 201 1435 58470400
168624668 Radewoosh F Aug. 16, 2022, 8:39 p.m. OK GNU C++17 TESTS 201 1435 58470400
168608654 Um_nik F Aug. 16, 2022, 5:53 p.m. OK GNU C++17 TESTS 201 2870 11264000
168629986 Expert_0_ F Aug. 16, 2022, 10:21 p.m. OK GNU C++17 (64) TESTS 201 1591 70963200
168634972 Nyaan F Aug. 17, 2022, 12:44 a.m. OK GNU C++17 (64) TESTS 201 1981 9625600
168636122 Nyaan F Aug. 17, 2022, 1:10 a.m. OK GNU C++17 (64) TESTS 201 2027 9625600
168614586 Nyaan F Aug. 16, 2022, 6:37 p.m. OK GNU C++17 (64) TESTS 201 2043 9625600
168608137 Nyaan F Aug. 16, 2022, 5:51 p.m. OK GNU C++17 (64) TESTS 201 2589 9216000
168629947 Expert_0_ F Aug. 16, 2022, 10:20 p.m. OK GNU C++20 (64) TESTS 201 1465 70963200
168597010 tourist F Aug. 16, 2022, 4:29 p.m. OK GNU C++20 (64) TESTS 200 1825 10240000
168599096 jeroenodb F Aug. 16, 2022, 4:32 p.m. OK GNU C++20 (64) TESTS 200 2152 7782400
168594764 jtnydv25 F Aug. 16, 2022, 4:25 p.m. OK GNU C++20 (64) TESTS 200 2184 64307200
168627277 simonlindholm F Aug. 16, 2022, 9:24 p.m. OK GNU C++20 (64) TESTS 201 2355 240435200
168636149 meaningIess F Aug. 17, 2022, 1:10 a.m. OK GNU C++20 (64) TESTS 201 2495 258764800
168635858 meaningIess F Aug. 17, 2022, 1:05 a.m. OK GNU C++20 (64) TESTS 201 2526 258764800
168638277 meaningIess F Aug. 17, 2022, 1:51 a.m. OK GNU C++20 (64) TESTS 201 2542 258764800
168623114 simonlindholm F Aug. 16, 2022, 8:16 p.m. OK GNU C++20 (64) TESTS 201 2573 240537600
168637788 meaningIess F Aug. 17, 2022, 1:42 a.m. OK GNU C++20 (64) TESTS 201 2635 258764800
168634357 qwerty787788 F Aug. 17, 2022, 12:28 a.m. OK Rust 2021 TESTS 201 2979 250982400
168634522 qwerty787788 F Aug. 17, 2022, 12:32 a.m. OK Rust 2021 TESTS 201 2995 250982400
168634496 qwerty787788 F Aug. 17, 2022, 12:32 a.m. OK Rust 2021 TESTS 201 2995 250982400

remove filters

Back to search problems