Quantcast
Browsing all 39796 articles
Browse latest View live

RIVPILE - Editorial

PROBLEM LINKPracticeContestDIFFICULTYMEDIUMPREREQUISITESShortest Path Problem, Dijkstra's AlgorithmPROBLEMYou are given N points in a plane. You are given M types of disks. Each disk has some cost...

View Article


Computing Factorials of a huge number in C/C++: A tutorial

Hello @all,As in MARCH13 contest we needed to use primary school arithmetics once again, and as it is a topic that comes up quite frequentely here in the forums thanks to this problem, and also, as I...

View Article


Runtime Error(SIGSEGV)

/Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input...

View Article

Runtime Error(SIGSEGV)

/Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input...

View Article

Holes in the text

What wrog with this code!#include<iostream> #include<cstring> using namespace std; int main() { int counter=0,sum=0; int T,n; char string[100]; cout<<"Number of the words:...

View Article


subset problem

Given n positive real numbers, find whether there exists a triplet among this set such that, the sum of the triplet is in the range (1, 2). Do it in linear time and O (1) space.

View Article

Update of gcc to 4.8.1

Just submit a solution and notice the change. Now codechef online judge updated to gcc 4.8.1 whereas previously it was 4.3.2.Notice just one change.Its taking 0.6 MB of extra memory.If anybody knows...

View Article

Wrong answer for tester's solution in July long contest farasa-editorial

I was reading the Farasa Editorial to learn more about FFT n the code written in the tester's solution. I copied method3 n FFT method n submitted I got wrong answer ... Anyway after 2 wrong answers...

View Article


turbo sort problem

#include<iostream> #include<algorithm> using namespace std; int main() { int t; cin>>t; int array[t]; if(t<=10*10*10*10*10*10) { for(int i=0;i<t;i++) { cin>>array[i]; }...

View Article


JAVA submissions RE

It seems like all java submissions are getting runtime errors for some time now. I even submitted one of my ac solutions in one of the problems and it gave RE. Tried INSTEST and TEST (with previous ac...

View Article

ACPC10D problem on SPOJ. Getting TLE. PLEASE HELP!!!

Here is a link to the problem: http://www.spoj.com/problems/ACPC10D/ I have used DP and made the necessary optimizations however I still get a TLE. Here is my code: http://ideone.com/ASwkh0Please...

View Article

your name is mine

http://www.codechef.com/viewsolution/2184891 The solution submitted here is incorrect, as i think. I tried using the names as "joe john", the answer must have been NO but YES is being displayed.

View Article

What's wrong here?(Ambiguous Permutation Problem)

This is the problem I am attempting.(Ambiguous Permutation in easy section) I believe my code is ok . I know that I can make another array and compare but isn't that long? I'm new here, what am I...

View Article


why is not the value of y changing???

Hey guys...whys isn't the value of the "y" being changed up .... after the bfs() is being called up .Even though the value of "y" is being increased up in the bfs() function which is...

View Article

Small Factorials - C Code working on PC but wrong answer on codechef

For the problem Small Factorials I wrote the following C Code. It is working on my PC. I cross-checked the answer for 100! with a Python Script so answer is correct. I don't have any idea why this is...

View Article


CIELDIST - Editorial

PROBLEM LINKSPracticeContestDIFFICULTYCAKEWALKPREREQUISITESSimple math, Triangle inequalityPROBLEMWe have two markets S and T. We want to build two restaurants. The markets and restaurants can be...

View Article

[ATM problem] What is wrong here? I am getting NZEC error.

package main; import java.util.Scanner; public class Main { public static void main(String[] args) { int balance; double withdraw = 0; Scanner s=new Scanner(System.in); System.out.println("Enter...

View Article


Trouble on even number

Sums of consecutive positive integersFilename: Consecutive.javaInput file: consecutive.inConsider the following positive integers: 5, 25, 29, 41, and 100. Each of these numbers can be expressed as a...

View Article

what is wrong in this code??(Life universe......program)

class Input1 { public static void main(String args[]) { int a[]={1,2,88,42,99}; int i=0; while(a[i]!=42) { System.out.println(a[i]); i++; }; } }

View Article

Life, the Universe, and Everything - Run Time Error

So the exercise is: Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop...

View Article
Browsing all 39796 articles
Browse latest View live


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