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

Can anyone help me with Heights of Students from TCS Mockvita 2018 Contest?

Hello friends can someone tell me how to approach this problem ?@vijju123@taran_1407@vivek_1998299@meooow@john_smith_3@aryanc403@vbt_95

View Article


what is wrong with my code?

import java.util.*; class sol{ public static void main(String args[]){ Scanner scanner=new Scanner(System.in); int c=scanner.nextInt(); int f=scanner.nextInt(); int[] x=new int[f]; int[] y=new int[f];...

View Article


Weak test cases - CHANGNUM

It seems that this problem [hyperlinked] has weak test cases, or has forgotten to add a statement in the problem, that a[i] and b[i] are from 1 to n. The following is the test case which gives the...

View Article

i cant find why my code is not accepted it is giving wrong anwser but it is...

#include <iostream> #include <string.h> #include <ctype.h> using namespace std; int main() { int t; cin>>t; while(t--) { char s[1002]; cin>>s; int l=strlen(s); int...

View Article

spoj subarray problem

I have been trying this subarray problem on spoj for a while and used a segtree in my approach but it is giving tle. It passes all tc given in comments below but gives tle on submission. can someone...

View Article


Why I am getting TLE in CHEFCUP problem as the constraints are too small? Can...

Problem link - https://www.codechef.com/problems/CHEFCUPMy solution link - https://www.codechef.com/viewsolution/19354758I have done the solution in O(n) time complexity but still getting TLE instead...

View Article

Discuss Hygiene and Editorial Feedback

Hi Codechef community,I have been a part of the discuss forum for quite a while now and have seen that there are a few issues which needs to be addressed soon to maintain the hygiene of this...

View Article

MGCSET - Editorial

PROBLEM LINK:Div 1Div 2PracticeAuthor:Full nameTester:Full nameEditorialist:Oleksandr KulkovDIFFICULTY:SIMPLEPREREQUISITES:Basic combinatoricsPROBLEM:You have a sequence of integers $a_1,a_2,\dots,a_n$...

View Article


why getting wrong answer for transform the expression problem

import java.util.*; class Main{ public static int is_operator(char c) { if(c=='^'||c=='/'||c=='*'||c=='+'||c=='-') return 1; else return 0; } public static int precedence(char a ) { if(a=='^')//...

View Article


LAPIN - Editorial

Problem Link:PracticeContestDifficulty:CakewalkPre-requisites:ad-hocProblem:Given a string S, if we split it in the middle (if S has an odd number of characters, disregard the middle character), then...

View Article

sorting a single string that is separted by spaces

given string is abc abaa banana ban caba answer should be abc ab ban ban cab i need to sort and delete the duplicates in the string.how can i approach the problem in c++

View Article

Error in CF Round #499 Div2 C (Fly)

Though the editorial mentions a reverse iterative approach to solve the problem with O(N) time complexity, I used binary search to solve the problem. Even after multiple rechecks, I am unable to find...

View Article

why this is showing wrong answer

include<stdio.h>int fact(int num) { int r; if(num==1) return 1; return(num*fact(num-1)); } main(){int n,a[200],i; scanf("%d",&n); if(n>0 && n<=100){ for(i=1;i<=n;i++){...

View Article


Please HELP me to correct code

https://www.codechef.com/viewsolution/19356822

View Article

Does CodeChef have any Code Of Conduct?

I am new to CodeChef. I am not sure what can be considered as an improper conduct on this website. I do not want to be penalized for doing something unknowingly which is not the accepted behavior. Is...

View Article


NMNMX - Editorial

PROBLEM LINK:Div 1Div 2PracticeAuthor:Full nameTester:Full nameEditorialist:Oleksandr KulkovDIFFICULTY:EASYPREREQUISITES:Fermat's little theorem, modular arithmetics, basic combinatoricsPROBLEM:You're...

View Article

Image may be NSFW.
Clik here to view.

SUMPOWER - Editorial

Problem LinkPracticeContestAuthor:Ivan SafonovTester:Hasan JaddouhEditorialist:Bhuvnesh JainDifficultyEASYPrerequisitesPrefix sums, Sliding WindowProblemYou are given a string $S$ of length $N$ and an...

View Article


Chef and College Loc July 2018

students=int(input()) query=int(input()) li=list() for i in range(0,query): a,b,c=map(int,input().split()) if(a==0): li.append(b) li.append(c) if(a==1): if((b in li)and(c in li)): print("YES") else:...

View Article

Invitation to CodeChef July Lunchtime 2018!

Hello CodeChef Community!We’re excited to announce the July Lunchtime 2018 sponsored by ShareChat. We hope to see you all join us in these 3 intense hours of coding challenges. Plus there are some...

View Article

CODECHEF Attendance

CODECHEF Attendance ToolHey There Guys,Hope You all are having a good time. I want to present you another tool which can show you your attendance in CodeChef.This is especially useful for those who...

View Article
Browsing all 39796 articles
Browse latest View live


Latest Images