Блог пользователя yash_daga

Автор yash_daga, история, 3 года назад, По-английски

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.

  • Проголосовать: нравится
  • +68
  • Проголосовать: не нравится

»
3 года назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

Yesterday's contest has a 30 minute long queue.

Can you confirm faster judging time today?

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +14 Проголосовать: не нравится

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

»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 года назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

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

»
3 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится
»
3 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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?

»
3 года назад, скрыть # |
 
Проголосовать: нравится -25 Проголосовать: не нравится

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

»
3 года назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

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

  • »
    »
    3 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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)