Dominater069's blog

By Dominater069, 22 months ago, In English

We invite you to participate in CodeChef’s Starters143, this Wednesday, 17th July, rated for till 5-Stars(ie. for users with rating < 2200).

Time: 8:00 PM — 10:00 PM IST

Joining us on the problem setting panel are:

Written editorials will be available for all on discuss.codechef.com. Pro users can find the editorials directly on the problem pages after the contest. The video editorials of the problems will be available only to Pro users.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here. Hope to see you participating.

The following is the count of problems in each division :

  • Division 1 : 5 problems
  • Division 2 : 6 problems
  • Division 3 and 4 : 7 problems

Good Luck!

UPD : Congratulations to the top 5!

  1. jeroenodb
  2. kdu_4
  3. maspy
  4. liympanda
  5. Kude
  • Vote: I like it
  • +44
  • Vote: I do not like it

| Write comment?
»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I see what you've done there, stealing contribution from the contest admin yash_daga! /j

»
22 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Dominater069 (previous revision, new revision, compare).

»
22 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Dominater round

»
22 months ago, hide # |
 
Vote: I like it -9 Vote: I do not like it

C++23 when

»
22 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

interesting problems!!

»
22 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

good problems

»
22 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Can someone help me find the bug in my code for Binary Conversion? I can't seem to find what's wrong with the code. A small counterexample would be appreciated.

Edit: nevermind, generated testcases against a correct solution and found the bug

void solve(){
    int n, k;
    cin >> n >> k;
    string s1, s2;
    cin >> s1 >> s2;
    auto temp1 = s1, temp2 = s2;
    sort(temp1.begin(),temp1.end()); sort(temp2.begin(),temp2.end());
    if(temp1!=temp2) {
        cout << "NO" << endl;
        return;
    }
    int dif = 0;
    for(int i = 0; i < n; i++) if(s1[i] != s2[i]) dif++;
    bool ok = true;
    if(n==2) {
        if(s1!=s2 && k%2 ==0) ok = false; 
        else if (s1==s2 && k%2 ==1) ok = false;
        if(ok) cout << "YES" << endl;
        else cout << "NO" << endl;
        return;
        
    }
    if(dif/2 <= k) cout << "YES" << endl;
    else cout << "NO" << endl;
}
»
22 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

Can someone tell me how do you solve LEXMINBIN from yesterday's contest? Thanks