Codeforces Round 959 sponsored by NEAR (Div. 1 + Div. 2) IMPORTANT NOTE: Now, we have decided to shift our focus to find and post leaks of the contest and help codeforces in the plagiarism check so that they can have ideally all the leaked solutions
I would like to thank the entire Cheat Patrol team for exposing cheaters. Special thanks to Vladosiya for actively helping us in the server and taking actions on convicted cheaters
If you are interested in volunteering us in exposing cheaters. You can join our Cheat Patrol server : Cheat Patrol Discord Server
Leaked Solution of A:
A Leak void solve(){
int numElements, maxSplit;
cin>>numElements>>maxSplit;
vector<int> elementSequence;
elementSequence.push_back(numElements);
int splitCount=0;
while(elementSequence.size() < numElements)
{
int currentElement=elementSequence.back();
elementSequence.erase(elementSequence.begin()+elementSequence.size()-1);
for(int i=0;i<min(maxSplit-1,currentElement-1);i++)
{
elementSequence.push_back(1);
}
elementSequence.push_back(currentElement-maxSplit+1);
splitCount++;
}
cout<<splitCount<<endl;
}
Leaked Solution of B:
B Leakvoid solve() {
int n;
cin >> n;
string s;
cin >> s;
vector<int> v;
char prev = '1';
for (int i = 0; i < n; i++) {
if (s[i] == '1') v.push_back(1);
if (s[i] == '0' && prev == '1') v.push_back(0);
prev = s[i];
}
int n0 = 0, n1 = 0;
for (int i = 0; i < v.size(); i++) {
if (v[i] == 1) n1++;
else n0++;
}
if (n0 >= n1) cout << "NO" << endl;
else cout << "YES" << endl;
Leaked Solution of C:
C Leak #include <bits/stdc++.h>
using namespace std;
#define ll long long
void process_subsegments() {
ll num_elements, max_sum;
cin >> num_elements >> max_sum;
ll elements_array[num_elements], prefix_sum_array[num_elements + 1] = {0}, dynamic_programming_array[num_elements + 3] = {0};
// Read elements array
for (ll i = 0; i < num_elements; ++i) {
cin >> elements_array[i];
prefix_sum_array[i + 1] = prefix_sum_array[i] + elements_array[i];
}
ll total_valid_subsegments = 0;
// Process subsegments in reverse order
for (ll i = num_elements - 1; i >= 0; --i) {
ll target_sum = prefix_sum_array[i] + max_sum;
// Find the lower bound of the target sum in the prefix sum array
auto lower_bound_index = lower_bound(prefix_sum_array, prefix_sum_array + num_elements + 1, target_sum) - prefix_sum_array;
// Calculate the number of valid subsegments
if (lower_bound_index == num_elements + 1)
dynamic_programming_array[i] += (num_elements - i);
else if (target_sum == prefix_sum_array[lower_bound_index])
dynamic_programming_array[i] += (lower_bound_index - i) + dynamic_programming_array[lower_bound_index + 1];
else
dynamic_programming_array[i] += (lower_bound_index - i - 1) + dynamic_programming_array[lower_bound_index];
}
// Calculate the total number of valid subsegments
for (ll i = 0; i < num_elements + 3; ++i) {
total_valid_subsegments += dynamic_programming_array[i];
}
cout << total_valid_subsegments << endl;
}
int main() {
ll test_cases = 1;
cin >> test_cases;
while (test_cases--) {
process_subsegments();
}
return 0;
}
List of Cheater for Reported in Community:
You can join our Cheat Patrol server to report Cheaters : Cheat Patrol Discord Server
I would like to request MikeMirzayanov to take actions on the cheaters as well people who are leaking the solutions.
Here is the drive link : Leaked Solution Drive Anyone with this code has just copied from here .
Shout Out: A big shoutout to our server member for one of the biggest cheating exposure on codeforces. https://mirror.codeforces.com/blog/entry/131781