I would like to request the Codeforces team to take action against cheaters. I have evidence against a prominent YouTube channel that consistently leaks solutions. Cheating demotivates genuine participants who work hard but don't see improvements in their ratings.
If anyone else has a better idea, please share it with the team.
Problem A
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int testCaseCount;
cin >> testCaseCount;
while (testCaseCount--) {
int rowCount, columnCount;
cin >> rowCount >> columnCount;
vector<vector<int>> originalMatrix(rowCount, vector<int>(columnCount));
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
cin >> originalMatrix[rowIndex][columnIndex];
if (rowCount == 1 && columnCount == 1) {
cout << -1 << endl;
continue;
}
vector<int> flatElements;
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
flatElements.push_back(originalMatrix[rowIndex][columnIndex]);
rotate(flatElements.begin(), flatElements.begin() + 1, flatElements.end());
vector<vector<int>> transformedMatrix(rowCount, vector<int>(columnCount));
int elementIndex = 0;
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++)
for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
transformedMatrix[rowIndex][columnIndex] = flatElements[elementIndex++];
bool isValid = true;
for (int rowIndex = 0; rowIndex < rowCount && isValid; rowIndex++)
for (int columnIndex = 0; columnIndex < columnCount; columnIndex++)
if (originalMatrix[rowIndex][columnIndex] == transformedMatrix[rowIndex][columnIndex])
isValid = false;
if (!isValid) {
cout << -1 << endl;
} else {
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) {
for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) {
cout << transformedMatrix[rowIndex][columnIndex] << " ";
}
cout << endl;
}
}
}
return 0;
}
Problem B
#include <iostream>
#include <vector>
using namespace std;
// Function prototypes
int getA();
vector<char> getB(int size);
void displayC();
void displayD();
void processE() {
int f = getA();
vector<char> g = getB(f);
vector<char> h = getB(f);
for (int i = 0; i < f; i++) {
if (g[i] == '0' && h[i] == '1') {
displayC();
return;
}
if (g[i] == '0' && h[i] == '0') continue;
else break;
}
displayD();
}
void startF() {
int j = 1;
j = getA();
while (j-- > 0) processE();
}
int main() {
startF();
return 0;
}
// Helper functions
int getA() {
int k;
cin >> k;
return k;
}
vector<char> getB(int size) {
vector<char> l(size);
for (int m = 0; m < size; ++m) {
cin >> l[m];
}
return l;
}
void displayC() {
cout << "NO" << endl;
}
void displayD() {
cout << "YES" << endl;
}
Problem C
#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;
}
Some Nice Screenshots from Live Stream Chat
https://mirror.codeforces.com/contest/1994/submission/271246853 check out this solution admins thanks.
Are you publicizing cheating?
Why would I do that? For your information I am beyond ratings now a days. I have been already well settled in my life. I just did this to save community from this cheating problem. Its evident that someone need to monitor third party services such as yt for potential leaks. I have shared how exactly they are sharing codes in hope that codeforces team will take action against cheaters and will keep monitoring on third party services. It will significantly help us to clean. I have just shared my motivation behind the post, if you still feel I am trying to promote these kind of shit things I am ready to delete this post.
bro cheaters just make the day worse for all of us
c was hell for most people like me but knowing that some people literally solved it by copy and pasting ruins my day
ZeroCoolCorp , ZeoCool (same person?)
Wtf Weak
Near the end of the contest I got pretty bored so I was interested if someone solved D, i didn't plan on copying anything or copied anything, I solved ABC on my own I swear, you can look at my codes and see that they arent copied
the fact you were even on that stream is wrong tbh
I know :(
You didn't even submit D, my bad, sorry bro.