Quantcast
Channel: CodeChef Discuss - latest questions
Browsing all 39796 articles
Browse latest View live
↧

How to solve SPOJ QTREE with centroid decomposition?

It's quite easy with HLD but I have no idea how to implement it so I went with centroid decomposition. Handling the max queries is relatively simple but I have no idea on how to to update. My idea is...

View Article


Codigo2K17 :: KNIT Sultanpur

Greetings folks!We would like to inform that KNIT Sultanpur is back with its annual flagship Coding Contest Codigo2k17. Just like the previous iterations, this year's Codigo will be even more exciting...

View Article


FCTRL2 getting wrong answer

import java.util.*;class RainBowa {public static void main(String a[]) { int n, t, fact; Scanner sc = new Scanner(System.in); t = sc.nextInt(); int ar[] = new int[t]; for (int i = 0; i < t; i++) {...

View Article

How to gain reputation in Codechef?

I am new to codechef so please any one guide to how to increase reputation?

View Article

can u send me the logic to solve this question

There are N cities in a kingdom. These cities are aligned in a row. So, each city has two neighbours except first and last city. Each city has an F-number which denotes the maximum cities he can ask...

View Article


INSQ15_F - Editorial

PROBLEM LINK:PracticeContestAuthor:vishfrndsTester:codefor6768Editorialist:vishfrndsDIFFICULTY:MEDIUMPREREQUISITES:dijkstra's algorithm basic graph theoryPROBLEM:Given a graph of N nodes. i-th node has...

View Article

JULKA:spoj problem

can anyone please tell me what is wrong with this code..it give WA on spoj include<bits stdc++.h="">using namespace std; int main() { int l,m,t,i; char ta[101],ma[101]; int x[101],y[101]; for(int...

View Article

Help with this problem

https://www.hackerrank.com/contests/dyuthi-game-of-codes-2/challenges/nice-sequence I tried this problem during the contest but was able to pass only a few test cases.I tried solving it using dynamic...

View Article


Can you please tell me why NZEC occurs?

public class Main{ public static void main (String[] args) throws java.io.IOException{ java.io.BufferedReader r = new java.io.BufferedReader(new java.io.InputStreamReader (System.in)); int n,k,t,c;...

View Article


CHEFCH - Editorial

PROBLEM LINK:PracticeContestAuthor:Dmytro BerezinTester:Pushkar MishraEditorialist:Florin ChiricaPROBLEMYou're given a string of $+$ and $-$ symbols. A string is called a chain if it does not have two...

View Article

array index 10^3 vs 1000

Hi Everyone,While I am trying to solve problem:Add two no's, I initialized the array to arr[10^3] (somewhere I have seen this way in an answer in codechef) and I was wondering that its not working. I...

View Article

Balanced Brackets(stack implementation)

I wrote this code for the problem Balanced Brackets but I can't seem to know why it gives segmentation fault in some test cases.https://www.hackerrank.com/challenges/balanced-brackets/problemchar*...

View Article

CS Academy Round #52 with Prizes

Hi all,I would like to invite you to CS Academy's next contest which takes place on Wednesday. There will be some money prizes awarded to the top 2 participants. You can find out more details on the...

View Article


Merge Sort Tree - Tutorial

Prerequisites : Segment TreesTarget Problem : Given an array of N elements and you have to answer Q queries of the form L R K , To Count the numbers smaller than K in range L to R.Key Idea : The key...

View Article

Concatenation of Strings C++

I recently came to know that the operator+ is overloaded in c++ to concatenate two strings but it is highly inefficient(Complexity: linear in terms of resulting string). I searched about it but could...

View Article


My answer is correct but the question does not accept it.

Question : CIELAB.import java.util.*;public class Main{public static void main(String []args) { Scanner sc=new Scanner(System.in); long a,b,x,d; a=sc.nextInt(); b=sc.nextInt(); x=a-b; d=x%10; x=x/10;...

View Article

How to know whether a problem passed all test cases in topcoder practice ?

I am a beginner. I have started coding in Topcoder. Now in arena after selecting a Div-2 200 point problem I submit it after 10 min. Then it says "submitting for 200 pt". Now I got somewhat 163 points....

View Article


Data Structures and Algorithms

Hi all, I need your help to make a list of most used data structures and algorithms along with their tutorials, implementation and some problems on them. It will be helpful to everyone in many ways. I...

View Article

what could be the most optimum way to check balanced parenthesis?

I have one string which can only have '(' and ')' ex: ((())) or ()()() now I want to check whether this parenthesis is balanced or not.static boolean isValidSequence(char []s){ char[] temp=new...

View Article

ACM ICPC Kolkata Kanpur site 2017

At the time of making Demand Draft for ACM ICPC Kanpur 2017, there is need of Bank Branch name and Bank Branch code. But, these informations are not provided anywhere. Can anyone help in finding the...

View Article
Browsing all 39796 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>