EPIC Institute of Technology Round August 2024 (Div. 1 + 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
2002 EPIC Institute of Technology Round August 2024 (Div. 1 + Div. 2) FINISHED False 10800 53018723 Aug. 11, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 575 ) F2 Court Blue (Hard Version) PROGRAMMING brute force dp math number theory

This is the hard version of the problem. In this version, it is not guaranteed that (n=m), and the time limit is higher. You can make hacks only if both versions of the problem are solved. In the court of the Blue King, Lelle and Flamm are having a performance match. The match consists of several rounds. In each round, either Lelle or Flamm wins. Let (W_L) and (W_F) denote the number of wins of Lelle and Flamm, respectively. The Blue King considers a match to be successful if and only if: after every round, (\gcd(W_L,W_F)\le 1); at the end of the match, (W_L\le n, W_F\le m). Note that (\gcd(0,x)=\gcd(x,0)=x) for every non-negative integer (x). Lelle and Flamm can decide to stop the match whenever they want, and the final score of the performance is (l \cdot W_L + f \cdot W_F). Please help Lelle and Flamm coordinate their wins and losses such that the performance is successful , and the total score of the performance is maximized. The first line contains an integer (t) ((1\leq t \leq 10^3)) — the number of test cases. The only line of each test case contains four integers (n), (m), (l), (f) ((2\leq n\leq m \leq 2\cdot 10^7), (1\leq l,f \leq 10^9)): (n), (m) give the upper bound on the number of Lelle and Flamm's wins, (l) and (f) determine the final score of the performance. Unusual additional constraint : it is guaranteed that, for each test, there are no pairs of test cases with the same pair of (n), (m). For each test case, output a single integer — the maximum total score of a successful performance. In the first test case, a possible performance is as follows: Flamm wins, (\gcd(0,1)=1). Lelle wins, (\gcd(1,1)=1). Flamm wins, (\gcd(1,2)=1). Flamm wins, (\gcd(1,3)=1). Flamm wins, (\gcd(1,4)=1). Lelle and Flamm agree to stop the match. The final score is (1\cdot2+4\cdot5=22).

Tutorials

EPIC Institute of Technology Round August 2024 (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
275853830 by_chance F2 Aug. 11, 2024, 6:57 p.m. OK C++14 (GCC 6-32) TESTS 46 3624 320614400
275853706 by_chance F2 Aug. 11, 2024, 6:56 p.m. OK C++14 (GCC 6-32) TESTS 46 3624 320716800
275879988 LXH-cat F2 Aug. 12, 2024, 2:19 a.m. OK C++17 (GCC 7-32) TESTS 46 374 42291200
275844353 Sorting F2 Aug. 11, 2024, 5:28 p.m. OK C++17 (GCC 7-32) TESTS 46 750 20070400
275858857 0wuming0 F2 Aug. 11, 2024, 7:46 p.m. OK C++17 (GCC 7-32) TESTS 46 858 40448000
275858723 0wuming0 F2 Aug. 11, 2024, 7:45 p.m. OK C++17 (GCC 7-32) TESTS 46 889 40448000
275861940 Sorting F2 Aug. 11, 2024, 8:25 p.m. OK C++17 (GCC 7-32) TESTS 46 1030 30822400
275846400 oceeff F2 Aug. 11, 2024, 5:33 p.m. OK C++17 (GCC 7-32) TESTS 46 1999 174796800
275886448 lprdsb F2 Aug. 12, 2024, 3:44 a.m. OK C++17 (GCC 7-32) TESTS 46 2140 160870400
275836393 oleh1421 F2 Aug. 11, 2024, 5:02 p.m. OK C++17 (GCC 7-32) TESTS 46 2171 23040000
275842525 _Yuru_ F2 Aug. 11, 2024, 5:23 p.m. OK C++17 (GCC 7-32) TESTS 46 2499 11468800
275877719 Tobo F2 Aug. 12, 2024, 1:49 a.m. OK C++17 (GCC 7-32) TESTS 46 2577 10547200
275857330 m7a1g5i8k8a1r4p0 F2 Aug. 11, 2024, 7:30 p.m. OK C++20 (GCC 13-64) TESTS 46 234 102400
275887060 shalinim.aiml2023 F2 Aug. 12, 2024, 3:52 a.m. OK C++20 (GCC 13-64) TESTS 46 265 102400
275857723 m7a1g5i8k8a1r4p0 F2 Aug. 11, 2024, 7:34 p.m. OK C++20 (GCC 13-64) TESTS 46 265 102400
275844240 Sana F2 Aug. 11, 2024, 5:28 p.m. OK C++20 (GCC 13-64) TESTS 46 593 97587200
275871049 linearspace F2 Aug. 11, 2024, 11:33 p.m. OK C++20 (GCC 13-64) TESTS 46 671 102400
275882819 bulijiojiodibuliduo F2 Aug. 12, 2024, 2:58 a.m. OK C++20 (GCC 13-64) TESTS 46 717 219238400
275885178 mhb2010 F2 Aug. 12, 2024, 3:27 a.m. OK C++20 (GCC 13-64) TESTS 46 733 20070400
275857271 m7a1g5i8k8a1r4p0 F2 Aug. 11, 2024, 7:29 p.m. OK C++20 (GCC 13-64) TESTS 46 858 102400
275838154 Forested F2 Aug. 11, 2024, 5:09 p.m. OK C++20 (GCC 13-64) TESTS 46 937 0
275844644 N_z__ F2 Aug. 11, 2024, 5:29 p.m. OK C++20 (GCC 13-64) TESTS 46 1109 190566400
275867082 n685 F2 Aug. 11, 2024, 9:51 p.m. OK Rust 2021 TESTS 46 3030 16486400

remove filters

Back to search problems