Codeforces Round 305 (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
547 Codeforces Round 305 (Div. 1) FINISHED False 7200 299165099 May 26, 2015, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2888 ) C Mike and Foam PROGRAMMING bitmasks combinatorics dp math number theory 2700

B"Mike is a bartender at Rico's bar. At Rico's, they put beer glasses in a special shelf. There are n kinds of beer at Rico's numbered from 1 to n. i-th kind of beer has ai milliliters of foam on it. Maxim is Mike's boss. Today he told Mike to perform q queries. Initially the shelf is empty. In each request, Maxim gives him a number x. If beer number x is already in the shelf, then Mike should remove it from the shelf, otherwise he should put it in the shelf. After each query, Mike should tell him the score of the shelf. Bears are geeks. So they think that the score of a shelf is the number of pairs (i, xe2 x80 x89j) of glasses in the shelf such that i xe2 x80 x89< xe2 x80 x89j and where is the greatest common divisor of numbers a and b. Mike is tired. So he asked you to help him in performing these requests. The first line of input contains numbers n and q (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xe2 x80 x89 xc3 x97 xe2 x80 x89105), the number of different kinds of beer and number of queries. The next line contains n space separated integers, a1, xe2 x80 x89a2, xe2 x80 x89... , xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x895 xe2 x80 x89 xc3 x97 xe2 x80 x89105), the height of foam in top of each kind of beer. The next q lines contain the queries. Each query consists of a single integer integer x (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n), the index of a beer that should be added or removed from the shelf. For each query, print the answer for that query in one line."...

Tutorials

Codeforces Round #305 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
13658622 xszxxc C Oct. 16, 2015, 5:56 a.m. OK FPC TESTS 43 685 26009600 2700
21399283 s34vv1nd C Oct. 13, 2016, 9:01 a.m. OK FPC TESTS 43 811 35840000 2700
21403653 s34vv1nd C Oct. 13, 2016, 1:06 p.m. OK FPC TESTS 43 826 35840000 2700
11341084 RNS C May 29, 2015, 5:07 a.m. OK GNU C++ TESTS 43 155 10854400 2700
12826784 unknown_shadow C Sept. 3, 2015, 10:13 a.m. OK GNU C++ TESTS 43 156 7475200 2700
40213528 SovietPower C July 11, 2018, 11:51 p.m. OK GNU C++ TESTS 43 171 4812800 2700
40213623 SovietPower C July 12, 2018, midnight OK GNU C++ TESTS 43 186 5120000 2700
29619656 jiyutian C Aug. 20, 2017, 11:34 a.m. OK GNU C++ TESTS 43 186 13824000 2700
40986591 ReaLNero1 C July 30, 2018, 8:38 p.m. OK GNU C++ TESTS 43 187 7475200 2700
40256013 Scut82 C July 13, 2018, 9:05 a.m. OK GNU C++ TESTS 43 187 16691200 2700
12140909 ayaze C July 21, 2015, 2:56 a.m. OK GNU C++ TESTS 43 202 4608000 2700
11300298 KrK C May 26, 2015, 6:12 p.m. OK GNU C++ TESTS 43 202 4812800 2700
11384825 Kudryavka C June 2, 2015, 2:17 a.m. OK GNU C++ TESTS 43 202 9625600 2700
43176901 CMXRYNP C Sept. 21, 2018, 11:49 a.m. OK GNU C++11 TESTS 43 124 17920000 2700
43178125 CMXRYNP C Sept. 21, 2018, 12:17 p.m. OK GNU C++11 TESTS 43 155 18227200 2700
51394912 ashen_one C March 17, 2019, 3:36 a.m. OK GNU C++11 TESTS 43 171 11059200 2700
43179875 WizardCowboy C Sept. 21, 2018, 12:56 p.m. OK GNU C++11 TESTS 43 171 12288000 2700
26221398 tFGaQdmbhJHV C April 8, 2017, 2:38 p.m. OK GNU C++11 TESTS 43 171 18124800 2700
53863570 phungha C May 8, 2019, 12:38 a.m. OK GNU C++11 TESTS 43 187 9011200 2700
53863560 phungha C May 8, 2019, 12:37 a.m. OK GNU C++11 TESTS 43 187 9011200 2700
65510330 LittleBeetle C Nov. 22, 2019, 3:10 a.m. OK GNU C++11 TESTS 43 187 27033600 2700
11415449 Yukii C June 4, 2015, 3:26 p.m. OK GNU C++11 TESTS 43 187 30105600 2700
11595744 cuiaoxiang C June 15, 2015, 3 p.m. OK GNU C++11 TESTS 43 202 4812800 2700
25296564 Not_A_SingleDogQrz C March 6, 2017, 3:42 p.m. OK GNU C++14 TESTS 43 234 11673600 2700
28072092 kenenalmat C June 27, 2017, 8:22 a.m. OK GNU C++14 TESTS 43 249 9113600 2700
28655051 Jori C July 18, 2017, 4:37 a.m. OK GNU C++14 TESTS 43 249 11980800 2700
30495566 kolyukkonen C Sept. 19, 2017, 11:39 a.m. OK GNU C++14 TESTS 43 249 17920000 2700
31949337 ChesterKing C Nov. 1, 2017, 12:24 p.m. OK GNU C++14 TESTS 43 265 12800000 2700
23392684 Ali.Pi C Dec. 29, 2016, 8:06 a.m. OK GNU C++14 TESTS 43 280 6963200 2700
35405647 tymo C Feb. 17, 2018, 11:10 a.m. OK GNU C++14 TESTS 43 280 7168000 2700
38957402 Zxyelf C June 5, 2018, 1:52 a.m. OK GNU C++14 TESTS 43 280 11264000 2700
48954521 Gnoud__ C Jan. 26, 2019, 3:38 a.m. OK GNU C++14 TESTS 43 280 11980800 2700
51213097 0ogway C March 12, 2019, 9 a.m. OK GNU C++14 TESTS 43 280 18329600 2700
54731626 Kuroni C May 28, 2019, 12:49 a.m. OK GNU C++17 TESTS 43 249 5017600 2700
68289360 twangal C Jan. 5, 2020, 8:08 p.m. OK GNU C++17 TESTS 43 249 8192000 2700
47450067 Shayan.P C Dec. 24, 2018, 9:02 a.m. OK GNU C++17 TESTS 43 249 8499200 2700
53082565 unused C April 21, 2019, 7:24 a.m. OK GNU C++17 TESTS 43 265 7168000 2700
58465070 spellstaker C Aug. 8, 2019, 6:54 p.m. OK GNU C++17 TESTS 43 280 11980800 2700
37687295 rawatds C April 28, 2018, 1:36 p.m. OK GNU C++17 TESTS 43 280 13824000 2700
54817898 LinaInverse C May 29, 2019, 9:58 p.m. OK GNU C++17 TESTS 43 280 16384000 2700
54817866 LinaInverse C May 29, 2019, 9:56 p.m. OK GNU C++17 TESTS 43 295 12800000 2700
65531290 hjk1030 C Nov. 22, 2019, 12:32 p.m. OK GNU C++17 TESTS 43 311 14336000 2700
69208286 Amireza C Jan. 20, 2020, 6:49 p.m. OK GNU C++17 TESTS 43 311 32256000 2700
11289144 uwi C May 26, 2015, 5:14 p.m. OK Java 7 TESTS 43 311 39014400 2700
11521497 Sumeet.Varma C June 10, 2015, 12:50 p.m. OK Java 7 TESTS 43 608 53862400 2700
11317985 Sergey.Bankevich C May 27, 2015, 11:12 a.m. OK Java 7 TESTS 43 655 36249600 2700
11316153 I_love_Malika C May 27, 2015, 9 a.m. OK Java 7 TESTS 43 717 66457600 2700
11308510 tehqin C May 26, 2015, 7:57 p.m. OK Java 7 TESTS 43 748 69529600 2700
11288340 xiaowuc1 C May 26, 2015, 5:10 p.m. OK Java 7 TESTS 43 1060 101785600 2700
11524956 alibaba C June 10, 2015, 6:37 p.m. OK Java 7 TESTS 43 1590 63795200 2700
11326155 peter31415 C May 27, 2015, 9:32 p.m. OK Java 7 TESTS 43 1824 41369600 2700
47348056 Ahmad C Dec. 21, 2018, 9:57 p.m. OK Java 8 TESTS 43 327 0 2700
11329067 hama-du C May 28, 2015, 6:29 a.m. OK Java 8 TESTS 43 358 13004800 2700
11287484 qwerty787788 C May 26, 2015, 5:06 p.m. OK Java 8 TESTS 43 436 614400 2700
69170673 Ahmad C Jan. 20, 2020, 6:03 a.m. OK Java 8 TESTS 43 436 55398400 2700
13713177 YakutovDmitriy C Oct. 18, 2015, 1:17 p.m. OK Java 8 TESTS 43 498 30822400 2700
11309908 Junior94 C May 26, 2015, 9:37 p.m. OK Java 8 TESTS 43 561 716800 2700
37695446 beginner1010 C April 28, 2018, 9:21 p.m. OK Java 8 TESTS 43 561 60416000 2700
11508678 Yury_Bandarchuk C June 9, 2015, 10:52 a.m. OK Java 8 TESTS 43 577 307200 2700
11896131 Sinner C July 2, 2015, 11:19 a.m. OK Java 8 TESTS 43 608 24985600 2700
11363937 santa_calus C May 31, 2015, 7:39 a.m. OK Java 8 TESTS 43 639 2252800 2700
11344135 AnatolyTolstobrov C May 29, 2015, 10:43 a.m. OK MS C# TESTS 43 187 21708800 2700
11344083 AnatolyTolstobrov C May 29, 2015, 10:37 a.m. OK MS C# TESTS 43 202 21504000 2700
11305473 azukun C May 26, 2015, 6:57 p.m. OK MS C# TESTS 43 623 33280000 2700
11318808 Death_Knight_DK C May 27, 2015, 12:02 p.m. OK MS C++ TESTS 43 249 7577600 2700
11298565 Auster C May 26, 2015, 6:03 p.m. OK MS C++ TESTS 43 249 20992000 2700
11325434 RoKi C May 27, 2015, 8:25 p.m. OK MS C++ TESTS 43 265 6553600 2700
11320331 waltz C May 27, 2015, 1:34 p.m. OK MS C++ TESTS 43 280 5017600 2700
11321723 Ne0n25 C May 27, 2015, 3:09 p.m. OK MS C++ TESTS 43 296 9011200 2700
11344355 Hasan0540 C May 29, 2015, 11:04 a.m. OK MS C++ TESTS 43 296 10342400 2700
11356403 tangshitao C May 30, 2015, 12:05 p.m. OK MS C++ TESTS 43 327 21299200 2700
11305206 Manul C May 26, 2015, 6:54 p.m. OK MS C++ TESTS 43 342 31744000 2700
11320826 sister_what_hate_most C May 27, 2015, 2:09 p.m. OK MS C++ TESTS 43 405 24883200 2700
11323550 Carups C May 27, 2015, 5:26 p.m. OK MS C++ TESTS 43 405 49152000 2700
11324127 gnomnain C May 27, 2015, 6:13 p.m. OK Ocaml TESTS 43 514 6656000 2700
12027532 hellcoder C July 13, 2015, 9:37 a.m. OK Ocaml TESTS 43 514 6656000 2700
12027505 hellcoder C July 13, 2015, 9:35 a.m. OK Ocaml TESTS 43 561 6656000 2700
11332794 alexey.shchepin C May 28, 2015, 12:32 p.m. OK Ocaml TESTS 43 748 43212800 2700
69474590 kobae964 C Jan. 24, 2020, 3:42 p.m. OK Rust TESTS 43 405 26419200 2700

remove filters

Back to search problems