Yesterday even after solving three problems i got a delta negative which doesn,t usually happens when you solve three questions at the rating where i am so i searched for telegram channels and guess what i found, I found a telegram channel with over 3300 members, I don,t want to write the name here for obvious reasons, here are some of the solutions that were floating there
Solutions of C:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_map>
using namespace std;
void maximizeGoodPairs(string &s) {
int n = s.size();
unordered_map<char, int> freq;
for (char c : s) {
freq[c]++;
}
string result(n, ' ');
int idx = 0;
while (true) {
bool filled = false;
for (auto &[ch, count] : freq) {
if (count > 0) {
result[idx] = ch;
idx++;
count--;
filled = true;
if (idx >= n) {
idx = 1;
}
}
}
if (!filled) {
break;
}
}
cout << result << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
string s;
cin >> s;
maximizeGoodPairs(s);
}
return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void solve() {
int n;
string s;
cin >> n >> s;
vector<int> freq(26, 0);
// Count frequency of each character
for (char c : s) {
freq[c - 'a']++;
}
string even, odd;
// Fill two separate strings: one for even index positions and one for odd index positions
for (int i = 0; i < 26; ++i) {
if (freq[i] > 0) {
string chars(freq[i], 'a' + i);
if (even.size() <= odd.size()) {
even += chars;
} else {
odd += chars;
}
}
}
// Now alternate between even and odd strings
string result;
int i = 0, j = 0;
while (i < even.size() || j < odd.size()) {
if (i < even.size()) result += even[i++];
if (j < odd.size()) result += odd[j++];
}
cout << result << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
Solution of D1:
#include <iostream>
#include <unordered_set>
#include <sstream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tes;
cin >> tes;
ostringstream sb;
while (tes--) {
int que;
long long m;
cin >> que >> m;
int max_val = 0;
while (que--) {
int n;
cin >> n;
unordered_set<int> set;
int a[n];
for (int i = 0; i < n; ++i) {
cin >> a[i];
set.insert(a[i]);
}
int first = 0;
while (true) {
if (set.find(first) == set.end()) {
set.insert(first);
break;
}
++first;
}
while (true) {
if (set.find(first) == set.end()) {
max_val = max(max_val, first);
break;
}
++first;
}
}
if (m >= max_val) {
long long ans = (long long)max_val * (max_val + 1);
long long big = (m * (m + 1)) / 2 - ans / 2;
sb << (ans + big) << '\n';
} else {
long long ans = (long long)max_val * (m + 1);
sb << ans << '\n';
}
}
cout << sb.str();
return 0;
}
Solution of D2:
#include<bits/stdc++.h> using namespace std; #dPfinn int long long int sum(int x) { return x*(x+1) ; } int interval(int I,int r) { return sum(r)-sum(I-1); } vector<int> son[1000001]; int dp[1000001]; void solve() int n,m,s=0,mint=0; map<int,int> cnt; cin B; n B; m; for(int i=1,u,v;i<=n;++0 { int I; cin B; I; set<int> t; for(int i=1,x;i<=1;++0 { cin B; x; t.insert(x); } bool flag=true; for(int i=0;;++i) { if(!t.count(i)) { if(flag) { flag=false; u=i; mint=max(mint,u); } else { v=i; break;}
}
} s=max(s,v);
son[v].push_back(u);
cnt[u]++;
} for(int i=0; i<=s; ++0 dp[i]=-1; for(int i=s; i>=0; --i) if(dp[i]==-1) dp[i]=i; for(int j:son[i]) dp[j]=max(dp[j],dp[i]);
} int pp=0; for(int i=0; i<=s; ++0 if(i<=mint) dp[i]=max(dp[i],mint); for(auto i:cnt) if(i.second>=2) pp=max(pp,dp[i.first]);
} for(int i=0; i<=s; ++0 dp[i]=max(dp[i],pp); for(int i=0; i<=s; ++0 son[i].clear(); if(m<=s) int sum=0; for(int i=0; i<=m; ++0 sum+=dp[i]; cout B+ sum B+ endl; return;
} int sum=0; for(int i=0; i<=s; ++0 sum+=dp[i]; sum+=interval(s+1,m); cout B+ sum B+ endl;
} signed main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
int t;cin>>t;
while(t--)solve()
above D2 sol if rewritten using GPT
#include <bits/stdc++.h>
using namespace std;
#define int long long
int sum(int x) {
return x * (x + 1) / 2; // Corrected the sum formula
}
int interval(int I, int r) {
return sum(r) - sum(I - 1);
}
vector<int> son[1000001];
int dp[1000001];
void solve() {
int n, m, s = 0, mint = 0;
map<int, int> cnt;
cin >> n >> m;
for (int i = 1; i <= n; ++i) {
int l;
cin >> l;
set<int> t;
for (int j = 1; j <= l; ++j) {
int x;
cin >> x;
t.insert(x);
}
bool flag = true;
int u, v;
for (int j = 0;; ++j) {
if (!t.count(j)) {
if (flag) {
flag = false;
u = j;
mint = max(mint, u);
} else {
v = j;
break;
}
}
}
s = max(s, v);
son[v].push_back(u);
cnt[u]++;
}
for (int i = 0; i <= s; ++i) {
dp[i] = -1;
}
for (int i = s; i >= 0; --i) {
if (dp[i] == -1) dp[i] = i;
for (int j : son[i]) {
dp[j] = max(dp[j], dp[i]);
}
}
int pp = 0;
for (int i = 0; i <= s; ++i) {
if (i <= mint) dp[i] = max(dp[i], mint);
}
for (auto i : cnt) {
if (i.second >= 2) pp = max(pp, dp[i.first]);
}
for (int i = 0; i <= s; ++i) {
dp[i] = max(dp[i], pp);
}
for (int i = 0; i <= s; ++i) {
son[i].clear();
}
if (m <= s) {
int sum = 0;
for (int i = 0; i <= m; ++i) {
sum += dp[i];
}
cout << sum << endl;
return;
}
int sum = 0;
for (int i = 0; i <= s; ++i) {
sum += dp[i];
}
sum += interval(s + 1, m);
cout << sum << endl;
}
signed main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
int t;
cin >> t;
while (t--) solve();
return 0;
}
please zltzlt and Mike Mirzayanov do the testing again and ban all the accounts with these and similar solutions. Thank you and please upvote.
skill issue mate, D1 was very easy
who said D1 was hard, still so many people solving D1 is unusual
I think D1 can be solved in around 1-1.5 hours for pupil/specialist performance(with ABC solved beforehand). Finding the pattern was quite easy. Imo C is harder D1.
Yep!! Too much cheating!
Took me more than an hour to get through D1 and here newbies solving F. Newbies have become better than Masters it seems!
Now cheaters are giving their opinion on cheaters!!!! Wonderful!!!
can you specifically mention which submission you found similar?
and i know u from a previous id of similar name that got banned so you had to come up with this
Bruh check your unrated contests
there's just one unrated contest because of a code similar to a few participants. there are cases where your code can get slightly similar to someone else. i appealed for it but no response neither positive nor negative. couldnt do much about it so moved on.
So, you are saying that you practise 1000-1400 and out of nowhere in a contest where you took 40-50 min to solve B which is 1000 rated and and in next 40 min you submit directly 1900. Pls dont make fool of yourself(joker emoji)........
If I am not wrong we attempt B after doing A right? The timer shows at what time you completed it. If I start it at 20 mins and end at 45 that's 25 mins to solve it. And D1 wasn't 1900 rated that's a 1600 rated problem. 3rd thing I don't practice 1000-1400. I normally do 1300-1600 on avg. 1000 were a month back.
You are naive brother not us
If you solve 1300-1600 then why you took 1 wrong submission + 16 min and then another 21 minutes to solve 800's in yesterday's contest.
I guess the solutions were not available till that time.....
How is solving tougher problems linked to coming up with solutions for easier problems and implementing them at GM speed? For the 1 wrong submission the reason was exactly trying to solve it too fast, thus coming up with a wrong approach initially (compromising accuracy for speed coz that worked with the tc 1). Second, B wasn't 800 it was 1000+ atleast. Taking that much for a problem you haven't seen before is normal. And B was greedy. Greedy takes observation and case making. Being able to solve 1600 rated doesn't guarantee you will solve <1000 at GM speed.
All the non cheating pupils(mostly) have solved first two in about 20-30 min and for improving speed and identifying greedy you have already taken TLE course. I guess thats not working for you....
Greedy not yet covered in TLE. And I took it for learning new topics not improving speed. Speed improvement happens by practicing more easy problems (your level — 200 rating) and solving hard problems comes with solving higher level problems (your rating + 200). Both are two very different skills.
And I didn't still get your point how does doing a 1000 rated problem in 20 mins show that a 1600 one can't be done in 60 mins?
Yeah I also solved till B in 18 mins and some of my friends(pupil) solved till B in 12mins. So definitely there is a doubt but maybe he is innocent and we are just doubting very hard
In codeforces round 963 (div 2) you took 6 freaking minutes to solve C and just check submission file. All the variable name clearly looks chatgpt generated. All you did was ask gpt to change variable names. LMAO.... I know you are person with 0 integrity and ethics. You wil be replying that all the time you were bloody trying B and C together....ahahahahhahahhahah..
Soln for B: 274401420
Soln for C 274404581
You have used such woderful variable (gpt generated names) and written C in 6 min .........WOW
Bruh I checked your profile your actual rating level ain't newbie/pupil. They can't solve 77 problems in 2 weeks. That too are mostly 1200+ means you are way too comfortable in 1500 or even 1600 rated problems. Maybe you are just coming from some other platform like codechef or something. Your current rating is highly deflated and isn't an actual measure of your skill level. It will get balanced in maybe 5-6 more contests but IMO your actual level is upper specialist/expert if you solved those problems on your own without seeing solutions.
You can notice this thing on profiles of many other high rated players who came here after practicing from other platforms. Most LGMs are like that who were already trained in cp and just happened to join cf later. They initially started from expert but if you see their contest ranks they got like under 20. That's an extreme example but my point is your case is similar and you aren't rated rightly as of now.
no bro I am definitely not expert level but close to 1400 level that's true as I am able to solve 1400 rated problems 30-40% on my own as of now. I am just grinding hard right now just reached in y 3rd sem and want to reach candidate master by the end of 4th sem (definitely too ambitious goal but I am trying) and let me tell you I don't even know dp and graphs till now XD I am just trying to master basics now :)
how many hours do u spend per day? and this isnt your first account right?
mf answer your justification for codeforces round 963 istead of this bullshit
i would answer that and you would come up with some even more senseless thing like you did till now so better you quit cheating and getting your accounts banned and start learning so that you dont have to ask this silly questions again
lmaoooooo naivedyam reply why are you a cheater
alright this is going to be the last one.
it is an old contest when i used to write proper variable names which can be seen in old submissions i made at that time unofficially.
no one works at 2 problems at once. we make certain crucial observations and if it isnt clicking for the time being we simply move on. and after solving we return to the old problem and try again. so saying things like "you solved them parallely" or "your took so much time for b and so less for c" doesnt make much sense.
you yourself admitted you are a cheater on a previous comment and from what i can see only cheaters are calling me out for exposing them here.
Still cannot digest the 6 min part and when did I say I am a cheater ? Or when did I got banned?
At the end, all I want to say is #NAIVEDYAMISACHEATER
You won't digest it coz you never solved beyond B without cheating :)
Anyone who gives it genuinely and has given 10+ contests can understand what I said. And yeah about the part of you being banned you had an account with similar username that got deleted due to cheating and we had exposed you
Bruh what similar name? I never got banned. I have account with way different name from this. And last I am not a cheater like you crybaby.
LAST REPLY TO THIS DEBATE: I have got 25 upvotes as of now on you initial comment with 7 downvotes makes it very clear who is honest and who is a cheater.....
Someone's getting exposed again :)
well I solved a in 4 min wrote in 2 min and 2 min to use some examples to see if my sol is correct
that's called alt accounts but alright
ABC are easy but D1 and D2 are harder for sure
I think difficulty is relative...For example, some candidates found D1 easier than C during the contest.
True, C was more of an intuition based question while D1 was observation. While both were nice questions, difficulty might vary from person to person
In C ,there were two condition on which we can count a pair
(i,j)
in the answer.s[i]=s[j]
(say 1)s[k]!=s[k+1] and (s[i]!=s[k] or s[k]!=s[j])
(say 2)now try to combine both, as any one condition will be enough...
try to find
1 OR 2
.Breakdown 2 into smaller conditions and apply De Morgan's Law. I hope you will find the path to the answer. Hope this provides a new POV.I didn't quite get it. Don't you think you just reiterated what the question had given? As in, I don't think using de Morgan's law and breaking down into smaller conditions helps. Could you give a detailed example for this?
I agree, I thought I had a proof during the contest. Only to later realise that my solution is only one of the many correct solutions. And my "proof" is incorrect!
(s[i] == s[j]) or (s[k] != s[k + 1] and (s[i] != s[k] or s[k] != s[j]));
(s[i] == s[j] or s[k] != s[k + 1]) and (s[i] == s[j] or s[i] != s[k] or s[k + 1] != s[j]);
this means for a substring a.....b there must be a X in between such that a!=X and minimum length will be 3 as
ab
is not valid butacb
orac.....b
will add 1 to the answer each.so the task becomes to maximise the number of b's for every
a..X..b
, this will be maximised whena
andX
are not equal, and the string be of the formaX.....b
and by doing this all rest of the upcoming b's will be valid.to tackle this problem we can equalise the most frequent character to the second most frequent character and then thereafter just alternating the characters while decreasing there count.
i think i am not able to convey it properly. :(
Problem C was to find best string where at best $$$1<=i<n $$$ and $$$a[i]!=a[i+1]$$$ which means you can use 2 letters with maximum frequency every step and find answer no matter what.
And Problem D1 was just find best second $$$MEX$$$.
Auto comment: topic has been updated by a_for_abdullah (previous revision, new revision, compare).
This is what I have got from telegram group!
// #include <bits/stdc++.h> // using namespace std; // #define int long long
// int sum(int x) { // return x*(x+1)/2; // } // int f(int l,int r) { // return sum(r)-sum(l-1); // } // void solve() { // int n,m,s=0; // cin >> n >> m; // for(int i=1;i<=n;++i) { // int l; // cin >> l; // set t; // for(int i=1,x;i<=l;++i) { // cin >> x; // t.insert(x); // } // bool flag=true; // for(int i=0;;++i) { // if(!t.count(i)) { // if(flag) flag=false; // else { // s=max(s,i); // break; // } // } // } // } // if(m<=s) cout << s*(m+1) << endl; // else cout << s*(s+1)+f(s+1,m) << endl; // } // signed main() { // int t; // cin >> t; // while(t--){ // solve(); // }
// }
FOR D1 @Mirzayanov
for D1 Mike Mirzayanov
I think the average IQ has increased by 70-80% in India. That is why greys and pupils from there solve ABCD under 30 mins. I believe if they try, they might invent a time machine.
Somehow greys solving upto div2 D but when it comes to online assessment of any company they are unable to solve a single problem properly.
Rick and Morty gang
Yessir!
Bro, i shouldn't be saying this but indians are famous for cheating.
As an Indian let me tell you why this is happening. 1) There are several famous youtubers that made all the hype about competitive programming for the crowd by saying cp will lead to million value income jobs. 2) Since the competition for Tech jobs in India is huge so even some companies are sorting to the idea of CF ratings for shortlisting of candidates. 3) The population itself is so huge that if something becomes a little famous here you will see inflation in competition. And some people end up resorting so cheating when they can't keep up with the competition.
true those bhaiya/didi needs to stop the CP hype similar thing was happening in open source too. I do CP for fun I like it got introduced to it by my friend and liked it did some research and found luv sir playlist and studied from it till number theory
Same. CP is good when you stop caring about ratings
Current intern season in Indian colleges is also leading to a lot of mass cheating I believe. It rose massively within month, completely aligning with internship season.
yeah! Check D1 submission of newbies and pupil in last contest you will find :
Like they cant be more identical.
vanshtomar001 d1 and c problem’s solutions match same code
Can we somehow avoid having this thread after every round?
How many of these blatant cases are not addressed after the plagiarism check?
Not many. But emotions get the best of us lower rated guys.
but after solving till C in div2 which is really great thing for pupils when they get -ve it breaks the heart even though everyone say don't let rating get over your mind but it is really hard and when you know that due to cheaters u got -ve it gets more heartbreaking and leads to this types of blogs and I have noticed alot of times the mentioned persons in the blog get skipped contest
Which would you prefer:
Yeah I completely understand if 2nd happens then also people we just post blogs why no rating changes so I prefer the current way the things happen and I also agree that cheating blogs are increasing after every contest which annoy us but can we do something about it? I know one of my friends college mate cheat and my friend told about that to me and said that guy is cheating consistently from 4-5 contest but didn't got skipped till now and he cheated in the last contest too and that just discourage the honest guys who have low ratings.
attractors is this another of my alts?
ok, maybe not
lol , your profile is full of skipped solutions in your profile(*out of contest) its just funny how you are bringing the matter to light . Give up on cheating start working there is no point if you dont enjoy the problems
lol, bro himself got skipped in this contest