Codeforces Round 864 (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
1797 Codeforces Round 864 (Div. 2) FINISHED False 7200 56217263 April 8, 2023, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1354 ) E Li Hua and Array PROGRAMMING brute force data structures math number theory

B'Li Hua wants to solve a problem about varphi -- Euler 's totient function. Please recall that varphi(x)= sum limits_{i=1}^x[ gcd(i,x)=1] . ^{ dagger, ddagger} He has a sequence a_1,a_2, cdots,a_n and he wants to perform m operations: Suppose you were Li Hua, please solve this problem. ^ dagger gcd(x,y) denotes the greatest common divisor (GCD) of integers x and y . ^ ddagger The notation [ textrm{cond}] equals 1 if the condition textrm{cond} is true, and 0 otherwise. The first line contains two integers n and m ( 1 <= n,m <= 10^{5} ) -- the number of elements in the array and the number of operations to process, respectively. The second line contains n integers a_{1},a_{2}, cdots ,a_{n} ( 1 <= a_{i} <= 5 cdot 10^{6} ) -- the elements of the array. Next m lines, each line contains three integers t_{i},l_{i},r_{i} ( t_i in {1,2 },1 <= l_i <= r_i <= n ) -- the i -th operation. For each "2 l r ", output the answer in an separate line. Denote varphi^k(x)= begin{cases}x,&k=0 varphi( varphi^{k-1}(x)),&k > 0 end{cases} . At first, a=[8,1,6,3,7] . To make sure a_1=a_2=a_3=a_4=a_5 , we can change a to a '=[ varphi^3(8), varphi^0(1), varphi^2(6), varphi^2(3), varphi^3(7)]=[1,1,1,1,1] , using 3+0+2+2+3=10 changes. To make sure a_3=a_4 , we can change a to a '=[ varphi^0(8), varphi^0(1), varphi^1(6), varphi^1(3), varphi^0(7)]=[8,1,2,2,7] , using 0+0+1+1+0=2 changes. After "1 1 3 ", a is changed to a=[ varphi^1(8), varphi^1(1), varphi^1(6), varphi^0(3), varphi^0(7)]=[4,1,2,3,7] . To make sure a_3=a_4 , we can change a to a '=[ varphi^0(4), varphi^0(1), varphi^0(2), varphi^1(3), varphi^0(7)]=[4,1,2,2,7] , using 0+0+0+1+0=1 change. '...

Tutorials

Codeforces Round 864 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
201352762 jrsy E April 8, 2023, 4:49 p.m. OK GNU C11 TESTS 70 748 70144000
201403885 include_BM E April 9, 2023, 1:41 a.m. OK GNU C++14 TESTS 70 343 66969600
201409242 2022lishujia E April 9, 2023, 3:07 a.m. OK GNU C++14 TESTS 70 358 480972800
201363085 Lstg E April 8, 2023, 5:50 p.m. OK GNU C++14 TESTS 70 467 70144000
201353631 0wuming0 E April 8, 2023, 4:53 p.m. OK GNU C++14 TESTS 70 514 71782400
201400978 zltzlt E April 9, 2023, 12:46 a.m. OK GNU C++14 TESTS 70 514 76800000
201400813 zltzlt E April 9, 2023, 12:43 a.m. OK GNU C++14 TESTS 70 546 75571200
201400826 zltzlt E April 9, 2023, 12:43 a.m. OK GNU C++14 TESTS 70 561 188825600
201352816 wuhudsm E April 8, 2023, 4:49 p.m. OK GNU C++14 TESTS 70 748 76083200
201422600 KurashinaAsuka E April 9, 2023, 5:55 a.m. OK GNU C++14 TESTS 70 841 230912000
201418806 Crying E April 9, 2023, 5:18 a.m. OK GNU C++14 TESTS 70 935 199782400
201385704 OMG_wc E April 8, 2023, 8:51 p.m. OK GNU C++17 TESTS 70 312 51916800
201370644 APIC E April 8, 2023, 6:50 p.m. OK GNU C++17 TESTS 70 452 47411200
201422923 PCC E April 9, 2023, 5:58 a.m. OK GNU C++17 TESTS 70 452 65638400
201370396 APIC E April 8, 2023, 6:48 p.m. OK GNU C++17 TESTS 70 467 47001600
201370983 APIC E April 8, 2023, 6:52 p.m. OK GNU C++17 TESTS 70 514 89088000
201354100 Tima E April 8, 2023, 4:55 p.m. OK GNU C++17 TESTS 70 545 46899200
201370941 APIC E April 8, 2023, 6:52 p.m. OK GNU C++17 TESTS 70 545 89088000
201361425 abcpony E April 8, 2023, 5:39 p.m. OK GNU C++17 TESTS 70 577 208793600
201370799 APIC E April 8, 2023, 6:51 p.m. OK GNU C++17 TESTS 70 701 47411200
201394396 de_sousa E April 8, 2023, 10:33 p.m. OK GNU C++17 TESTS 70 717 28569600
201367954 VegeDog E April 8, 2023, 6:27 p.m. OK GNU C++17 (64) TESTS 70 311 138854400
201402231 Dawnq E April 9, 2023, 1:12 a.m. OK GNU C++17 (64) TESTS 70 420 75776000
201414441 cxm1024 E April 9, 2023, 4:24 a.m. OK GNU C++17 (64) TESTS 70 452 70348800
201415473 vjudge4 E April 9, 2023, 4:39 a.m. OK GNU C++17 (64) TESTS 70 483 70348800
201405322 zlxFTH E April 9, 2023, 2:04 a.m. OK GNU C++17 (64) TESTS 70 530 90214400
201404662 tute7627 E April 9, 2023, 1:54 a.m. OK GNU C++17 (64) TESTS 70 577 48332800
201353157 HCCH E April 8, 2023, 4:50 p.m. OK GNU C++17 (64) TESTS 70 592 80998400
201412291 tomato_potato E April 9, 2023, 3:52 a.m. OK GNU C++17 (64) TESTS 70 639 92569600
201355684 Chifwin E April 8, 2023, 5:03 p.m. OK GNU C++17 (64) TESTS 70 686 41062400
201359166 MateoCV E April 8, 2023, 5:24 p.m. OK GNU C++17 (64) TESTS 70 686 54886400
201385424 Ormlis E April 8, 2023, 8:49 p.m. OK GNU C++20 (64) TESTS 70 264 48128000
201355393 JupiterJazz E April 8, 2023, 5:01 p.m. OK GNU C++20 (64) TESTS 70 280 70553600
201408837 etilletas_ E April 9, 2023, 3:01 a.m. OK GNU C++20 (64) TESTS 70 295 66969600
201405076 LinkWish E April 9, 2023, 2 a.m. OK GNU C++20 (64) TESTS 70 311 53555200
201358980 joww E April 8, 2023, 5:23 p.m. OK GNU C++20 (64) TESTS 70 311 70348800
201404010 NULL_to_Miracle E April 9, 2023, 1:43 a.m. OK GNU C++20 (64) TESTS 70 327 70348800
201410189 quark4004 E April 9, 2023, 3:21 a.m. OK GNU C++20 (64) TESTS 70 327 149913600
201400058 vectorwyx E April 9, 2023, 12:26 a.m. OK GNU C++20 (64) TESTS 70 342 85299200
201359610 laurxh E April 8, 2023, 5:27 p.m. OK GNU C++20 (64) TESTS 70 343 480972800
201365631 Leonard E April 8, 2023, 6:08 p.m. OK GNU C++20 (64) TESTS 70 358 98816000
201355429 HugeHobbit E April 8, 2023, 5:02 p.m. OK Java 11 TESTS 70 623 42291200
201397221 dzhi E April 8, 2023, 11:25 p.m. OK Java 11 TESTS 70 2620 459673600
201393722 profchi E April 8, 2023, 10:22 p.m. OK Java 11 TESTS 70 2979 134553600
201355763 TCchen E April 8, 2023, 5:04 p.m. OK Java 17 TESTS 70 701 43929600
201360259 Dukkha E April 8, 2023, 5:31 p.m. OK Java 17 TESTS 70 1044 22016000
201369081 IanISam E April 8, 2023, 6:37 p.m. OK Java 8 TESTS 70 2027 99328000

remove filters

Back to search problems