yash_daga's blog

By yash_daga, history, 19 months ago, In English

We invite you to participate in CodeChef’s Starters 88, this Wednesday, 03rd May, rated till 6-stars Coders (ie. for users with rating < 2500).

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

Note that the duration is 2 hours. Read about the recent CodeChef changes here.

Joining us on the problem setting panel are: - Setters: Kanhaiya notsoloud1 Mohan, Ronit ro27 Bhatt, Yash PoPularPlusPlus Thakker, Mostafa Beevo Alaa, omkar triggered_code tripathi, Devansh DrisHyam_420 Aryan, Wuhudsm wuhudsm

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 for all users for 1 day as soon as the contest ends, after which they 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.

  • Vote: I like it
  • +68
  • Vote: I do not like it

| Write comment?
»
19 months ago, # |
  Vote: I like it +12 Vote: I do not like it

Yesterday's contest has a 30 minute long queue.

Can you confirm faster judging time today?

  • »
    »
    19 months ago, # ^ |
      Vote: I like it +45 Vote: I do not like it

    Unrated contests where the problems have higher (#test files * time limit) than recommended will face issues. Rated contests will not, as we have near-unlimitedly-scalable checkers turned on for these contests.

»
19 months ago, # |
Rev. 2   Vote: I like it +14 Vote: I do not like it

I have a suggestion to assign weight to every problem according to difficulty. Is that possible? CodeChef_admin

  • »
    »
    19 months ago, # ^ |
      Vote: I like it +22 Vote: I do not like it

    Yes, it is possible — we have organized such contests. But it is a conscious decision to have our rated contests with equal weights. There are multiple pros and cons to both systems, and we've just decided on equal weights.

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

Can GOOD_OPR be solved without calculating the formula for SUM(i*j*k) L <= i < j < k <= R ?

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

Can anyone tell me why my submission is incorrect? https://www.codechef.com/viewsolution/95676624 I have been trying for an hour to figure it out

»
19 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Did anyone else solve the MST problem using divide and conquer and rollback?

»
19 months ago, # |
  Vote: I like it +3 Vote: I do not like it
»
19 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Did something like this in UTLA,

for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
        int c = a[i] + a[j];
        next_dp[j][c] = max(next_dp[j][c], dp[c] + 2);
    }
    for (int j = 0; j < i; ++j) {
        int c = a[j] + a[i];
        dp[c] = max(dp[c], next_dp[i][c]);
    }
}

What is the name of this kind of dynamics when we maintain the state of the dynamics so that it always contains only pairs that end before i?

Can anyone suggest tasks where a similar approach can be used?

»
19 months ago, # |
  Vote: I like it -25 Vote: I do not like it

What is the point of making straight forward probability problem in contest? Is this a math exam?

  • »
    »
    19 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    there is modulo inverse also, you need to know how to take care of that as well. Also, you can't fit in all the answers within int or long long, so u need to take care of the overflows.

    that is the question. NOT SOME MATH PROBLEM.

    • »
      »
      »
      19 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I did it bro I know very well that but if they to make it math they can generate math exam not competitive contest

»
19 months ago, # |
  Vote: I like it -8 Vote: I do not like it

Problem : here Can someone help me with a test case this code fails at?

#include <bits/stdc++.h>
#include <iostream>
#define ll long long
using namespace std;


int main() {
	ll t; cin>>t;
	while(t--){
	   ll n; cin>>n;
	   string s; cin>>s;
	   vector <char> a,b;
	   ll j=0;
	   while(j<n && s[j]=='1'){  a.push_back('1'); b.push_back('0'); j++; }
	   for(ll i=j;i<n;i++){
	       if(s[i]=='0'){
	           a.push_back('0'); b.push_back('0'); continue;
	       }
	       ll k=i;
	       while(k<n && s[k]=='1') k++;
	       if(k-i==1){
	           a.push_back('1'); b.push_back('0');
	       }
	       else{
	           a.pop_back(); a.push_back('1');
	           for(ll p=0;p<k-i;p++){
	               a.push_back('0'); b.push_back('0');
	           }
	           b.pop_back(); b.push_back('1');
	           
	       }
	       i=k-1;
	       
	   }
	   for(auto x : a) cout<<x;
	   cout<<endl;
	   for(auto x : b) cout<<x;
	   cout<<endl;
	   
	}
	
	
	
	return 0;
}

Problem : here

  • »
    »
    19 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    We have to run the loop in reverse order( j -> n-1 to 0) ( see in editorial)

    for string 01110111, the sum of one's in answer should be 3( 10000000, 00001001)

    but the sum of one's in your output is 4 (10001000 , 00010001)