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 |
---|---|---|---|---|---|---|
1491 | Codeforces Global Round 13 | FINISHED | False | 10800 | 117303899 | Feb. 28, 2021, 1:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 18269 ) | A | K-th Largest Value | PROGRAMMING | brute force greedy implementation |
B"You are given an array a consisting of n integers. Initially all elements of a are either 0 or 1 . You need to process q queries of two kinds: As a reminder, k -th largest value of the array b is defined as following: For example, the second largest element in array [0, 1, 0, 1] is 1 , as after sorting in non-increasing order it becomes [1, 1, 0, 0] , and the second element in this array is equal to 1 . The first line contains two integers n and q ( 1 <= n, q <= 10^5 ) -- the length of the given array and the number of queries. The second line contains n integers a_1, a_2, a_3, ... , a_n ( 0 <= a_i <= 1 ) -- elements of the initial array. Each of the following q lines contains two integers. The first integer is t ( 1 <= t <= 2 ) -- the type of query. It's guaranteed that there will be at least one query of the second type (satisfying t = 2 ). For each query of the second type, print a single integer -- the answer to the query. Initially a = [1, 1, 0, 1, 0] . The first operation is printing the third largest value, which is 1 . The second operation is assigning a_2 the value 0 , a becomes [1, 0, 0, 1, 0] . The third operation is printing the third largest value, it is 0 . The fourth operation is printing the first largest value, it is 1 . The last operation is printing the fifth largest value, it is 0 . "... |
Codeforces Global Round 13 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
108762361 | 1473439561pp | A | March 1, 2021, 12:40 a.m. | OK | Clang++17 Diagnostics | TESTS | 8 | 857 | 512000 | ||
108764707 | SSerxhs | A | March 1, 2021, 2:26 a.m. | OK | GNU C++11 | TESTS | 8 | 15 | 9011200 | ||
108765673 | woshinibaba | A | March 1, 2021, 3:01 a.m. | OK | GNU C++11 | TESTS | 8 | 30 | 3993600 | ||
108767153 | sakuryu | A | March 1, 2021, 3:48 a.m. | OK | GNU C++11 | TESTS | 8 | 31 | 0 | ||
108762248 | fishcathu. | A | March 1, 2021, 12:32 a.m. | OK | GNU C++11 | TESTS | 8 | 31 | 0 | ||
108770189 | ETK. | A | March 1, 2021, 5:05 a.m. | OK | GNU C++11 | TESTS | 8 | 31 | 102400 | ||
108761672 | seeeagull | A | Feb. 28, 2021, 11:57 p.m. | OK | GNU C++11 | TESTS | 8 | 31 | 204800 | ||
108764860 | liang_cheng | A | March 1, 2021, 2:32 a.m. | OK | GNU C++11 | TESTS | 8 | 31 | 307200 | ||
108769886 | froggyzhang | A | March 1, 2021, 4:59 a.m. | OK | GNU C++11 | TESTS | 8 | 31 | 409600 | ||
108773727 | _xsl | A | March 1, 2021, 6 a.m. | OK | GNU C++11 | TESTS | 8 | 31 | 409600 | ||
108772793 | xiongjx | A | March 1, 2021, 5:45 a.m. | OK | GNU C++11 | TESTS | 8 | 31 | 409600 | ||
108769931 | sakapon | A | March 1, 2021, 5:01 a.m. | OK | .NET Core C# | TESTS | 8 | 124 | 7987200 |
Back to search problems