Codeforces Round 674 (Div. 3)

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
1426 Codeforces Round 674 (Div. 3) FINISHED False 7200 130542899 Sept. 28, 2020, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7478 ) E Rock, Paper, Scissors PROGRAMMING brute force constructive algorithms flows greedy math 1800

B'Alice and Bob have decided to play the game "Rock, Paper, Scissors". The game consists of several rounds, each round is independent of each other. In each round, both players show one of the following things at the same time: rock, paper or scissors. If both players showed the same things then the round outcome is a draw. Otherwise, the following rules applied: Alice and Bob decided to play exactly n rounds of the game described above. Alice decided to show rock a_1 times, show scissors a_2 times and show paper a_3 times. Bob decided to show rock b_1 times, show scissors b_2 times and show paper b_3 times. Though, both Alice and Bob did not choose the sequence in which they show things. It is guaranteed that a_1 + a_2 + a_3 = n and b_1 + b_2 + b_3 = n . Your task is to find two numbers: The first line of the input contains one integer n ( 1 <= n <= 10^{9} ) -- the number of rounds. The second line of the input contains three integers a_1, a_2, a_3 ( 0 <= a_i <= n ) -- the number of times Alice will show rock, scissors and paper, respectively. It is guaranteed that a_1 + a_2 + a_3 = n . The third line of the input contains three integers b_1, b_2, b_3 ( 0 <= b_j <= n ) -- the number of times Bob will show rock, scissors and paper, respectively. It is guaranteed that b_1 + b_2 + b_3 = n . Print two integers: the minimum and the maximum number of rounds Alice can win. In the first example, Alice will not win any rounds if she shows scissors and then paper and Bob shows rock and then scissors. In the best outcome, Alice will win one round if she shows paper and then scissors, and Bob shows rock and then scissors. In the second example, Alice will not win any rounds if Bob shows the same things as Alice each round. In the third example, Alice always shows paper and Bob always shows rock so Alice will win all three rounds anyway. '...

Tutorials

83120

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
94131451 siumai E Sept. 28, 2020, 1:30 p.m. OK GNU C11 TESTS 40 15 7475200 1800
94122585 link_pot E Sept. 28, 2020, 11:56 a.m. OK GNU C11 TESTS 40 31 0 1800
94122209 Shiro_S E Sept. 28, 2020, 11:52 a.m. OK GNU C11 TESTS 40 31 102400 1800
94127522 fearlessgao E Sept. 28, 2020, 12:49 p.m. OK GNU C++11 TESTS 40 15 0 1800
94179263 Am_mu E Sept. 29, 2020, 5:25 a.m. OK GNU C++11 TESTS 40 15 0 1800
94132670 aTSL E Sept. 28, 2020, 1:43 p.m. OK GNU C++11 TESTS 40 30 0 1800
94131770 aTSL E Sept. 28, 2020, 1:33 p.m. OK GNU C++11 TESTS 40 30 0 1800
94115939 secretbase E Sept. 28, 2020, 10:43 a.m. OK GNU C++11 TESTS 40 30 0 1800
94115508 thorin22 E Sept. 28, 2020, 10:38 a.m. OK GNU C++11 TESTS 40 30 0 1800
94111311 LKPl E Sept. 28, 2020, 10:06 a.m. OK GNU C++11 TESTS 40 30 0 1800
94174535 divyanshnaman1998 E Sept. 29, 2020, 3:40 a.m. OK GNU C++11 TESTS 40 30 0 1800
94134108 figdan E Sept. 28, 2020, 1:58 p.m. OK GNU C++11 TESTS 40 30 0 1800
94120554 Justwayyouare E Sept. 28, 2020, 11:34 a.m. OK GNU C++11 TESTS 40 30 1638400 1800
94170400 WiwiHo E Sept. 29, 2020, 1:37 a.m. OK GNU C++14 TESTS 40 31 0 1800
94169003 skumar62629 E Sept. 29, 2020, 12:41 a.m. OK GNU C++14 TESTS 40 31 0 1800
94168623 Rebro E Sept. 29, 2020, 12:26 a.m. OK GNU C++14 TESTS 40 31 0 1800
94168450 Bekh E Sept. 29, 2020, 12:18 a.m. OK GNU C++14 TESTS 40 31 0 1800
94167872 AK_weiye E Sept. 28, 2020, 11:47 p.m. OK GNU C++14 TESTS 40 31 0 1800
94167690 masterchef2209 E Sept. 28, 2020, 11:37 p.m. OK GNU C++14 TESTS 40 31 0 1800
94167380 wh2005 E Sept. 28, 2020, 11:19 p.m. OK GNU C++14 TESTS 40 31 0 1800
94180306 pinkfloyed E Sept. 29, 2020, 5:44 a.m. OK GNU C++14 TESTS 40 31 0 1800
94173118 apurvmayank E Sept. 29, 2020, 3:05 a.m. OK GNU C++14 TESTS 40 31 0 1800
94181056 __11235_Pawar E Sept. 29, 2020, 5:59 a.m. OK GNU C++14 TESTS 40 31 0 1800
94116223 fireboy009 E Sept. 28, 2020, 10:47 a.m. OK GNU C++17 TESTS 40 30 0 1800
94179472 aryanjunagade E Sept. 29, 2020, 5:29 a.m. OK GNU C++17 TESTS 40 31 0 1800
94181063 VivekUchiha E Sept. 29, 2020, 5:59 a.m. OK GNU C++17 TESTS 40 31 0 1800
94180991 richr6749 E Sept. 29, 2020, 5:57 a.m. OK GNU C++17 TESTS 40 31 0 1800
94180729 Nitaray E Sept. 29, 2020, 5:53 a.m. OK GNU C++17 TESTS 40 31 0 1800
94180622 smilingface E Sept. 29, 2020, 5:51 a.m. OK GNU C++17 TESTS 40 31 0 1800
94180332 Afraimov_Benyamin E Sept. 29, 2020, 5:45 a.m. OK GNU C++17 TESTS 40 31 0 1800
94180098 Chen_zsc E Sept. 29, 2020, 5:40 a.m. OK GNU C++17 TESTS 40 31 0 1800
94179544 amar277 E Sept. 29, 2020, 5:30 a.m. OK GNU C++17 TESTS 40 31 0 1800
94178805 AmarShukla E Sept. 29, 2020, 5:16 a.m. OK GNU C++17 TESTS 40 31 0 1800
94174674 ankeet E Sept. 29, 2020, 3:43 a.m. OK GNU C++17 (64) TESTS 40 15 0 1800
94147342 Mostafa_Moharm E Sept. 28, 2020, 4:18 p.m. OK GNU C++17 (64) TESTS 40 30 0 1800
94141961 raj1307 E Sept. 28, 2020, 3:18 p.m. OK GNU C++17 (64) TESTS 40 30 0 1800
94133784 sharma2908 E Sept. 28, 2020, 1:54 p.m. OK GNU C++17 (64) TESTS 40 30 0 1800
94127170 lucid_dreamer E Sept. 28, 2020, 12:45 p.m. OK GNU C++17 (64) TESTS 40 30 0 1800
94126680 SSYernar E Sept. 28, 2020, 12:40 p.m. OK GNU C++17 (64) TESTS 40 30 0 1800
94119025 ____ankit_sm____ E Sept. 28, 2020, 11:18 a.m. OK GNU C++17 (64) TESTS 40 30 0 1800
94163053 spongespong E Sept. 28, 2020, 8:39 p.m. OK GNU C++17 (64) TESTS 40 30 0 1800
94176170 tysm E Sept. 29, 2020, 4:21 a.m. OK GNU C++17 (64) TESTS 40 30 0 1800
94158650 smax E Sept. 28, 2020, 7:05 p.m. OK GNU C++17 (64) TESTS 40 30 0 1800
94172324 synapse E Sept. 29, 2020, 2:42 a.m. OK Go TESTS 40 46 0 1800
94111746 takezawa E Sept. 28, 2020, 10:08 a.m. OK Go TESTS 40 46 102400 1800
94143124 codelegend E Sept. 28, 2020, 3:30 p.m. OK Haskell TESTS 40 31 102400 1800
94167738 shiftyblock E Sept. 28, 2020, 11:39 p.m. OK Java 11 TESTS 40 187 0 1800
94151388 EVER_CURIOUS E Sept. 28, 2020, 5:09 p.m. OK Java 11 TESTS 40 202 0 1800
94173894 5612 E Sept. 29, 2020, 3:25 a.m. OK Java 11 TESTS 40 202 0 1800
94158420 Agnimandur E Sept. 28, 2020, 7:01 p.m. OK Java 11 TESTS 40 202 0 1800
94157023 Kimo_Fathy E Sept. 28, 2020, 6:38 p.m. OK Java 11 TESTS 40 202 0 1800
94140794 gladwin_rojer E Sept. 28, 2020, 3:06 p.m. OK Java 11 TESTS 40 202 0 1800
94129821 nirvana_rsc E Sept. 28, 2020, 1:13 p.m. OK Java 11 TESTS 40 202 0 1800
94113023 vaishnav_firebolt E Sept. 28, 2020, 10:16 a.m. OK Java 11 TESTS 40 202 0 1800
94111763 dhruvjain E Sept. 28, 2020, 10:08 a.m. OK Java 11 TESTS 40 202 0 1800
94111013 rohan03 E Sept. 28, 2020, 10:04 a.m. OK Java 11 TESTS 40 202 0 1800
94114532 subhash.yadav E Sept. 28, 2020, 10:29 a.m. OK Java 8 TESTS 40 108 0 1800
94170147 flyman3046 E Sept. 29, 2020, 1:27 a.m. OK Java 8 TESTS 40 109 0 1800
94150414 YahiaSherif E Sept. 28, 2020, 4:56 p.m. OK Java 8 TESTS 40 109 0 1800
94137794 idk321 E Sept. 28, 2020, 2:35 p.m. OK Java 8 TESTS 40 109 0 1800
94126810 kostasanemozalis E Sept. 28, 2020, 12:41 p.m. OK Java 8 TESTS 40 109 0 1800
94124534 TouchstONE98 E Sept. 28, 2020, 12:17 p.m. OK Java 8 TESTS 40 109 0 1800
94118810 jakejase2 E Sept. 28, 2020, 11:15 a.m. OK Java 8 TESTS 40 109 0 1800
94111750 gagan_6730 E Sept. 28, 2020, 10:08 a.m. OK Java 8 TESTS 40 109 0 1800
94178404 srvptk97 E Sept. 29, 2020, 5:08 a.m. OK Java 8 TESTS 40 124 0 1800
94165411 icpc_loser E Sept. 28, 2020, 9:47 p.m. OK Java 8 TESTS 40 124 0 1800
94169901 koboshi E Sept. 29, 2020, 1:17 a.m. OK Kotlin TESTS 40 124 0 1800
94120905 Mirimax E Sept. 28, 2020, 11:38 a.m. OK Kotlin TESTS 40 124 0 1800
94113178 sid9406 E Sept. 28, 2020, 10:17 a.m. OK Kotlin TESTS 40 124 0 1800
94116140 cmplx-xyttmt E Sept. 28, 2020, 10:46 a.m. OK Kotlin TESTS 40 140 0 1800
94176514 emsaksham E Sept. 29, 2020, 4:29 a.m. OK MS C++ 2017 TESTS 40 31 0 1800
94173620 songjunwei E Sept. 29, 2020, 3:18 a.m. OK MS C++ 2017 TESTS 40 31 0 1800
94171020 GreedyCoder999 E Sept. 29, 2020, 1:59 a.m. OK MS C++ 2017 TESTS 40 31 0 1800
94162064 SendThemToHell E Sept. 28, 2020, 8:16 p.m. OK MS C++ 2017 TESTS 40 31 0 1800
94153843 vladnoov E Sept. 28, 2020, 5:43 p.m. OK MS C++ 2017 TESTS 40 31 0 1800
94149474 semihpirpir E Sept. 28, 2020, 4:44 p.m. OK MS C++ 2017 TESTS 40 31 0 1800
94133424 transcending E Sept. 28, 2020, 1:50 p.m. OK MS C++ 2017 TESTS 40 31 0 1800
94140225 songjunwei E Sept. 28, 2020, 3 p.m. OK MS C++ 2017 TESTS 40 31 819200 1800
94113790 olafenok E Sept. 28, 2020, 10:22 a.m. OK MS C++ 2017 TESTS 40 46 0 1800
94169213 kclee2172 E Sept. 29, 2020, 12:49 a.m. OK PyPy 3 TESTS 40 139 0 1800
94177692 krishna369 E Sept. 29, 2020, 4:53 a.m. OK PyPy 3 TESTS 40 140 0 1800
94165494 Winavesh E Sept. 28, 2020, 9:50 p.m. OK PyPy 3 TESTS 40 140 0 1800
94145869 WeirdBugsButOkay E Sept. 28, 2020, 4 p.m. OK PyPy 3 TESTS 40 140 0 1800
94133056 pk31299 E Sept. 28, 2020, 1:46 p.m. OK PyPy 3 TESTS 40 140 0 1800
94122506 vadym.kaidalov E Sept. 28, 2020, 11:55 a.m. OK PyPy 3 TESTS 40 140 0 1800
94121365 sleepcode505 E Sept. 28, 2020, 11:43 a.m. OK PyPy 3 TESTS 40 140 0 1800
94120011 gourav2001k E Sept. 28, 2020, 11:28 a.m. OK PyPy 3 TESTS 40 140 0 1800
94118975 dominator1234 E Sept. 28, 2020, 11:17 a.m. OK PyPy 3 TESTS 40 140 0 1800
94115374 tomak E Sept. 28, 2020, 10:37 a.m. OK PyPy 3 TESTS 40 140 0 1800
94115405 sh1194 E Sept. 28, 2020, 10:37 a.m. OK Python 3 TESTS 40 93 0 1800
94135919 IngaleAnkur10 E Sept. 28, 2020, 2:16 p.m. OK Python 3 TESTS 40 93 307200 1800
94117043 testuser_ E Sept. 28, 2020, 10:56 a.m. OK Python 3 TESTS 40 93 307200 1800
94112594 sayan_india E Sept. 28, 2020, 10:14 a.m. OK Python 3 TESTS 40 93 307200 1800
94168825 Said_29 E Sept. 29, 2020, 12:34 a.m. OK Python 3 TESTS 40 108 0 1800
94117811 ramzz E Sept. 28, 2020, 11:05 a.m. OK Python 3 TESTS 40 108 0 1800
94125292 bing_007 E Sept. 28, 2020, 12:25 p.m. OK Python 3 TESTS 40 108 307200 1800
94113307 arvind_241999 E Sept. 28, 2020, 10:18 a.m. OK Python 3 TESTS 40 108 307200 1800
94132476 SmitVavliya E Sept. 28, 2020, 1:41 p.m. OK Python 3 TESTS 40 109 0 1800
94117565 mimifrau E Sept. 28, 2020, 11:02 a.m. OK Python 3 TESTS 40 109 0 1800
94131120 tuna_salad E Sept. 28, 2020, 1:26 p.m. OK Rust TESTS 40 31 0 1800
94172253 akks800 E Sept. 29, 2020, 2:39 a.m. OK Rust TESTS 40 46 204800 1800

remove filters

Back to search problems