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

a very easy problem

http://www.codechef.com/problems/EASYPROB/ plz explain the question

View Article


Why do I get a SIGSEGV?

Why I am getting a runtime error SIGSEGV in the problem? Where I am going wrong?

View Article


Slow Trains (BUG4EVER 2017) Weird Issue

Here are two of my submissions, exactly same, one in C and the other in C++. The submission in C++ gives an AC verdict while the submission in C gives a WA verdict. The code was originally written in...

View Article

TEST - Editorial

PROBLEM LINK:PracticeAuthor:ADMINEditorialist:SUSHANT AGARWALDIFFICULTY:CAKEWALKPREREQUISITES:Basic looping,Basic Input/OutputPROBLEM:Rewrite small numbers from input to output. Stop processing input...

View Article

How to allocate array using malloc

I want to allocate arrays that can store 109 variables , how do I do it ? Here's how I'm doing ,think it's not working int arr; arr= (long long )malloc(100000*sizeof(long long)) Anyone , any...

View Article


How to solve GTREE - "TREE GCD" ?

Problem Link (Contest) - https://www.codechef.com/LOCAUG17/problems/GTREEI tried to solve the above problem from LoC AUG 2017 and wrote a brute force solution (by doing a DFS from each node in its...

View Article

python 3 map problem

a = input() print( map(lambda x,y: x+y ,a.split(" ")))i want to add two numbers

View Article

Why do I get Wrong Answer?

Why is my program getting wrong answer?

View Article


what to write in last name in ICPC registration if I don't have one?

I was registering for ICPC and I realised I couldn't leave the last name field blank, nor can i put characters other than alphabets. I don't have any last name in any official document. What to do?

View Article


Transform the Expression

#include <iostream> #include <cstdlib> #include <cstdio> #include <algorithm> #include <stack> #include <vector> #include <string> using namespace std; typedef...

View Article

Maximum sum subsequence with top down approach

Hello, I am trying to solve the maximum sum subsequence problem, using topdown approach. I am able to come up with an O(n^3) solution, but want an O(n^2) solution. The reason I'm not going with the...

View Article

Eat all apples in the maze

Hello All, I've just started to learn how to solve competitive problems. I met such a problem, but not sure what would be a right way to solve it. Would really appreciate if you can help with that :)...

View Article

WHY IS THE CODE GIVING ME NZEC

This code is passing the first 2 test cases in the problem with AC and giving me 40 pts but not passing the last 2 cases. The solution is fast enough for the problem required and even after multiple...

View Article


SPOJ- PRIME GENERATOR WHY THIS CODE IS SHOWING TLE error.

include<stdio.h>int main() { int t,a,b,i,j,k,ct; scanf("%d",&t); for(i=1;i<=t;i++) { scanf("%d%d",&a,&b); for(j=a;j<=b;j++) { for(k=2,ct=0;k<=j/2;k++) {if(j%k==0) ct++;}...

View Article

Vector of 1000*1000 ints

I want to know, can I work on a multidimensional vector of 1000 rows and 1000 columns inside main function? I am neither passing this vector to any function nor declaring it globally.I am getting WA in...

View Article


why my soln to rainbowa giving wrong ans???

import java.util.Scanner;public class Main {public static void main(String[] args)throws java.lang.Exception { // TODO Auto-generated method stub Scanner s = new Scanner(System.in); int t =...

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


Why is it that my rainbow array code is giving wrong after submission?

//heres my codeinclude<iostream>using namespace std; int Check(int n,int a[]) { int count=0; for(int i=0;i<n 2;i++)="" {=""...

View Article

NZEC eroor in java

why i m getting NZEC here pls help...https://www.codechef.com/viewsolution/15302743

View Article

atm help getting wrong answer in C

#include<stdio.h> int main() { int X; float Y; scanf("%d",&X); printf("\t"); scanf("%.2f\n",&Y); if((X>Y)||(X%5!=0)) printf("%.2f",Y); else printf("%.2f",Y-X-0.50); return(0); }

View Article
Browsing all 39796 articles
Browse latest View live


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