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 |
---|---|---|---|---|---|---|
1493 | Codeforces Round 705 (Div. 2) | FINISHED | False | 8100 | 122140463 | March 6, 2021, 2:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 5139 ) | D | GCD of an Array | PROGRAMMING | data structures math number theory sortings two pointers |
B'You are given an array a of length n . You are asked to process q queries of the following format: given integers i and x , multiply a_i by x . After processing each query you need to output the greatest common divisor (GCD) of all elements of the array a . Since the answer can be too large, you are asked to output it modulo 10^9+7 . The first line contains two integers -- n and q ( 1 <= n, q <= 2 cdot 10^5 ). The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 2 cdot 10^5 ) -- the elements of the array a before the changes. The next q lines contain queries in the following format: each line contains two integers i and x ( 1 <= i <= n , 1 <= x <= 2 cdot 10^5 ). Print q lines: after processing each query output the GCD of all elements modulo 10^9+7 on a separate line. After the first query the array is [12, 6, 8, 12] , operatorname{gcd}(12, 6, 8, 12) = 2 . After the second query -- [12, 18, 8, 12] , operatorname{gcd}(12, 18, 8, 12) = 2 . After the third query -- [12, 18, 24, 12] , operatorname{gcd}(12, 18, 24, 12) = 6 . Here the operatorname{gcd} function denotes the greatest common divisor. '... |
Codeforces Round #705 (Div.2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
109282243 | rainboy | D | March 6, 2021, 5:21 p.m. | OK | GNU C11 | TESTS | 59 | 873 | 49049600 | ||
109288711 | zhuzhirui2005 | D | March 6, 2021, 6:58 p.m. | OK | GNU C++11 | TESTS | 59 | 187 | 41267200 | ||
109306998 | zhuzhirui2005 | D | March 7, 2021, 5:18 a.m. | OK | GNU C++11 | TESTS | 59 | 202 | 41267200 | ||
109302220 | Lu_Anlai | D | March 7, 2021, 3:21 a.m. | OK | GNU C++11 | TESTS | 59 | 202 | 44544000 | ||
109302110 | Lu_Anlai | D | March 7, 2021, 3:18 a.m. | OK | GNU C++11 | TESTS | 59 | 202 | 44544000 | ||
109297740 | tuagoale | D | March 7, 2021, 12:30 a.m. | OK | GNU C++11 | TESTS | 59 | 234 | 39424000 | ||
109288267 | zhuzhirui2005 | D | March 6, 2021, 6:50 p.m. | OK | GNU C++11 | TESTS | 59 | 280 | 39219200 | ||
109299438 | nuchenghao | D | March 7, 2021, 1:56 a.m. | OK | GNU C++11 | TESTS | 59 | 280 | 40960000 | ||
109269109 | yan_qiu_ynlchrz | D | March 6, 2021, 3:56 p.m. | OK | GNU C++11 | TESTS | 59 | 373 | 44748800 | ||
109273025 | lovelyz | D | March 6, 2021, 4:09 p.m. | OK | GNU C++11 | TESTS | 59 | 374 | 214630400 | ||
109274466 | ICANTAKIOI | D | March 6, 2021, 4:13 p.m. | OK | GNU C++11 | TESTS | 59 | 389 | 134758400 | ||
109297510 | usernameson | D | March 7, 2021, 12:11 a.m. | OK | GNU C++14 | TESTS | 59 | 264 | 113971200 | ||
109276270 | baodaqing | D | March 6, 2021, 4:18 p.m. | OK | GNU C++14 | TESTS | 59 | 312 | 55705600 | ||
109299695 | SuperJ6 | D | March 7, 2021, 2:04 a.m. | OK | GNU C++14 | TESTS | 59 | 342 | 49868800 | ||
109280616 | DMCS | D | March 6, 2021, 5:03 p.m. | OK | GNU C++14 | TESTS | 59 | 343 | 43827200 | ||
109280469 | DMCS | D | March 6, 2021, 5:02 p.m. | OK | GNU C++14 | TESTS | 59 | 358 | 43827200 | ||
109285724 | TheRoot | D | March 6, 2021, 6:08 p.m. | OK | GNU C++14 | TESTS | 59 | 545 | 38707200 | ||
109305057 | leapfrog | D | March 7, 2021, 4:37 a.m. | OK | GNU C++14 | TESTS | 59 | 560 | 180838400 | ||
109290203 | xt0r3 | D | March 6, 2021, 7:29 p.m. | OK | GNU C++14 | TESTS | 59 | 576 | 46489600 | ||
109282205 | zucc31801313 | D | March 6, 2021, 5:20 p.m. | OK | GNU C++14 | TESTS | 59 | 607 | 72192000 | ||
109289537 | mdtabish5600 | D | March 6, 2021, 7:14 p.m. | OK | GNU C++14 | TESTS | 59 | 608 | 51302400 | ||
109296944 | Rafi22 | D | March 6, 2021, 11:34 p.m. | OK | GNU C++17 | TESTS | 59 | 296 | 31744000 | ||
109278745 | Sh0 | D | March 6, 2021, 4:49 p.m. | OK | GNU C++17 | TESTS | 59 | 327 | 39424000 | ||
109267779 | ButterflyDew | D | March 6, 2021, 3:52 p.m. | OK | GNU C++17 | TESTS | 59 | 327 | 45568000 | ||
109278966 | uncountable | D | March 6, 2021, 4:50 p.m. | OK | GNU C++17 | TESTS | 59 | 343 | 45670400 | ||
109283547 | haoyun1 | D | March 6, 2021, 5:38 p.m. | OK | GNU C++17 | TESTS | 59 | 343 | 114688000 | ||
109285777 | rishi | D | March 6, 2021, 6:09 p.m. | OK | GNU C++17 | TESTS | 59 | 374 | 43520000 | ||
109276678 | G00DCOD3R | D | March 6, 2021, 4:19 p.m. | OK | GNU C++17 | TESTS | 59 | 389 | 52633600 | ||
109272277 | slah007 | D | March 6, 2021, 4:07 p.m. | OK | GNU C++17 | TESTS | 59 | 405 | 33792000 | ||
109294512 | razvan9310 | D | March 6, 2021, 9:30 p.m. | OK | GNU C++17 | TESTS | 59 | 421 | 45363200 | ||
109282426 | Leonardo_Paes | D | March 6, 2021, 5:23 p.m. | OK | GNU C++17 | TESTS | 59 | 421 | 54067200 | ||
109282268 | rainboy | D | March 6, 2021, 5:21 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 202 | 51609600 | ||
109269299 | Kude | D | March 6, 2021, 3:57 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 234 | 37785600 | ||
109293486 | kaiboy | D | March 6, 2021, 8:55 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 296 | 54374400 | ||
109278347 | IceKnight1093 | D | March 6, 2021, 4:46 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 311 | 70758400 | ||
109279920 | mohmahkho | D | March 6, 2021, 4:57 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 327 | 67481600 | ||
109280507 | m_99 | D | March 6, 2021, 5:02 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 342 | 62054400 | ||
109280772 | IceKnight1093 | D | March 6, 2021, 5:05 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 342 | 70758400 | ||
109282643 | cjoa | D | March 6, 2021, 5:26 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 389 | 70963200 | ||
109294768 | twoslowaf | D | March 6, 2021, 9:41 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 389 | 79667200 | ||
109267683 | Lam_lai_cuoc_doi | D | March 6, 2021, 3:51 p.m. | OK | GNU C++17 (64) | TESTS | 59 | 404 | 95436800 | ||
109273925 | sersht | D | March 6, 2021, 4:12 p.m. | OK | Go | TESTS | 59 | 1216 | 129536000 | ||
109293466 | Dukkha | D | March 6, 2021, 8:54 p.m. | OK | Java 11 | TESTS | 59 | 779 | 92672000 | ||
109305170 | Ahmed_Hosssam | D | March 7, 2021, 4:40 a.m. | OK | Java 11 | TESTS | 59 | 920 | 102297600 | ||
109270537 | Apfeloxid | D | March 6, 2021, 4:01 p.m. | OK | Java 11 | TESTS | 59 | 1044 | 96972800 | ||
109286950 | mohit_virmani49 | D | March 6, 2021, 6:28 p.m. | OK | Java 11 | TESTS | 59 | 1201 | 87244800 | ||
109284704 | baron_ | D | March 6, 2021, 5:54 p.m. | OK | Java 11 | TESTS | 59 | 1496 | 69324800 | ||
109294217 | Agnimandur | D | March 6, 2021, 9:19 p.m. | OK | Java 11 | TESTS | 59 | 1513 | 260608000 | ||
109279453 | Dukkha | D | March 6, 2021, 4:53 p.m. | OK | Java 11 | TESTS | 59 | 1669 | 138649600 | ||
109283322 | davgogol | D | March 6, 2021, 5:35 p.m. | OK | Java 11 | TESTS | 59 | 2059 | 63692800 | ||
109289939 | Dukkha | D | March 6, 2021, 7:23 p.m. | OK | Java 11 | TESTS | 59 | 2324 | 145305600 | ||
109289142 | Dukkha | D | March 6, 2021, 7:06 p.m. | OK | Java 11 | TESTS | 59 | 2464 | 230092800 | ||
109279773 | YahiaSherif | D | March 6, 2021, 4:56 p.m. | OK | Java 8 | TESTS | 59 | 1122 | 115200000 | ||
109296212 | reennn | D | March 6, 2021, 10:50 p.m. | OK | Java 8 | TESTS | 59 | 1232 | 100966400 | ||
109293118 | Code_Breaker | D | March 6, 2021, 8:43 p.m. | OK | Java 8 | TESTS | 59 | 1372 | 75264000 | ||
109292968 | Akram-Adel | D | March 6, 2021, 8:39 p.m. | OK | Java 8 | TESTS | 59 | 1793 | 117350400 | ||
109275192 | AdhmMohamed | D | March 6, 2021, 4:15 p.m. | OK | Java 8 | TESTS | 59 | 2417 | 77414400 | ||
109307054 | shojin_pro | D | March 7, 2021, 5:19 a.m. | OK | Java 8 | TESTS | 59 | 2464 | 163123200 | ||
109278963 | Tlatoani | D | March 6, 2021, 4:50 p.m. | OK | Kotlin | TESTS | 59 | 1154 | 128512000 | ||
109270403 | Golovanov399 | D | March 6, 2021, 4:01 p.m. | OK | Kotlin | TESTS | 59 | 2261 | 90214400 | ||
109287722 | koper | D | March 6, 2021, 6:41 p.m. | OK | Kotlin | TESTS | 59 | 2480 | 73830400 | ||
109275528 | r57shell | D | March 6, 2021, 4:16 p.m. | OK | MS C++ | TESTS | 59 | 296 | 21401600 | ||
109296930 | verigo | D | March 6, 2021, 11:33 p.m. | OK | MS C++ 2017 | TESTS | 59 | 1014 | 54067200 | ||
109278459 | Peton | D | March 6, 2021, 4:47 p.m. | OK | MS C++ 2017 | TESTS | 59 | 1091 | 147046400 | ||
109283576 | Cube219 | D | March 6, 2021, 5:38 p.m. | OK | MS C++ 2017 | TESTS | 59 | 1170 | 34508800 | ||
109296514 | verigo | D | March 6, 2021, 11:07 p.m. | OK | MS C++ 2017 | TESTS | 59 | 1949 | 76595200 | ||
109295089 | AaradhyaBittu | D | March 6, 2021, 9:55 p.m. | OK | MS C++ 2017 | TESTS | 59 | 2386 | 94515200 | ||
109272920 | mban259 | D | March 6, 2021, 4:09 p.m. | OK | .NET Core C# | TESTS | 59 | 2198 | 175616000 | ||
109291873 | kagu | D | March 6, 2021, 8:08 p.m. | OK | PyPy 2 | TESTS | 59 | 1232 | 96563200 | ||
109291843 | kagu | D | March 6, 2021, 8:07 p.m. | OK | PyPy 2 | TESTS | 59 | 1247 | 96358400 | ||
109283333 | sh1194 | D | March 6, 2021, 5:35 p.m. | OK | PyPy 3 | TESTS | 59 | 1278 | 76390400 | ||
109286150 | Satwik_Tiwari | D | March 6, 2021, 6:15 p.m. | OK | PyPy 3 | TESTS | 59 | 1325 | 86937600 | ||
109278346 | marroncastle | D | March 6, 2021, 4:46 p.m. | OK | PyPy 3 | TESTS | 59 | 1419 | 51404800 | ||
109296774 | oadey89 | D | March 6, 2021, 11:23 p.m. | OK | PyPy 3 | TESTS | 59 | 1918 | 97792000 | ||
109281896 | at_f | D | March 6, 2021, 5:16 p.m. | OK | PyPy 3 | TESTS | 59 | 1949 | 154316800 | ||
109310546 | GER_chen | D | March 7, 2021, 6:17 a.m. | OK | PyPy 3 | TESTS | 59 | 2012 | 128512000 | ||
109282864 | at_f | D | March 6, 2021, 5:29 p.m. | OK | PyPy 3 | TESTS | 59 | 2043 | 154726400 | ||
109289325 | akshitm16 | D | March 6, 2021, 7:10 p.m. | OK | PyPy 3 | TESTS | 59 | 2074 | 86732800 | ||
109294946 | manish.17 | D | March 6, 2021, 9:49 p.m. | OK | PyPy 3 | TESTS | 59 | 2105 | 122777600 | ||
109287460 | jimm89 | D | March 6, 2021, 6:36 p.m. | OK | PyPy 3 | TESTS | 59 | 2324 | 126156800 | ||
109278477 | GraphTheory | D | March 6, 2021, 4:47 p.m. | OK | Rust | TESTS | 59 | 701 | 64512000 | ||
109284715 | apilat | D | March 6, 2021, 5:54 p.m. | OK | Rust | TESTS | 59 | 950 | 57958400 |
Back to search problems