Educational Codeforces Round 107 (Rated for 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
1511 Educational Codeforces Round 107 (Rated for Div. 2) FINISHED False 7200 119114711 April 12, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 27857 ) A Review Site PROGRAMMING greedy

B"You are an upcoming movie director, and you have just released your first movie. You have also launched a simple review site with two buttons to press -- upvote and downvote. However, the site is not so simple on the inside. There are two servers, each with its separate counts for the upvotes and the downvotes. n reviewers enter the site one by one. Each reviewer is one of the following types: Each reviewer votes on the movie exactly once. Since you have two servers, you can actually manipulate the votes so that your movie gets as many upvotes as possible. When a reviewer enters a site, you know their type, and you can send them either to the first server or to the second one. What is the maximum total number of upvotes you can gather over both servers if you decide which server to send each reviewer to? The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. Then the descriptions of t testcases follow. The first line of each testcase contains a single integer n ( 1 <= n <= 50 ) -- the number of reviewers. The second line of each testcase contains n integers r_1, r_2, ... , r_n ( 1 <= r_i <= 3 ) -- the types of the reviewers in the same order they enter the site. For each testcase print a single integer -- the maximum total number of upvotes you can gather over both servers if you decide which server to send each reviewer to. In the first testcase of the example you can send the only reviewer to either of the servers -- they'll downvote anyway. The movie won't receive any upvotes. In the second testcase of the example you can send all reviewers to the first server: There are two upvotes in total. Alternatevely, you can send the first and the second reviewers to the first server and the last reviewer -- to the second server: "...

Tutorials

89634

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
112861491 Rafiqul_islam_robin A April 12, 2021, 5:04 p.m. OK .NET Core C# TESTS 5 139 2777088
112865993 Rafiqul_islam_robin A April 12, 2021, 5:51 p.m. OK .NET Core C# TESTS 5 155 3059712
112874154 robiul_hassan_rabby A April 12, 2021, 8:04 p.m. OK .NET Core C# TESTS 5 156 3301376

remove filters

Back to search problems