Académique Documents
Professionnel Documents
Culture Documents
Signup with
Have you tried CodeChefs "Code, Compile & Run" Its pretty cool. Try it out by pressing Ctrl+; and
typing "ide" [X]
Obstacle Course
ALL SUBMISSIONS SUBMIT
Problem code: COURSE
Like Share 13 people like this. Sign Up to see what your
friends like.
Input begins with an integer T (about 25), the number of test cases. View
sanketgarg 0.08 1.6M C
Each test case begins with 2 integers r and R (1<=r<R<=25000). The racetrack is
the area between the circles centered at (0,0) with radii r and R.
lehar_1106 0.08 2.2M C View
The next line of input contains an integer N (0<=N<=500), the number of cones.
N lines follow, each containing the coordinates of a cone. The coordinates are
integers, and are guaranteed to lie within the track, and be distinct. anup 0.09 1.6M C View
Cases are separated by a blank line.
divyabatra 0.09 1.6M C View
Output:
For each input, output on a single line the diameter of the largest car that g1g19 0.09 1.6M C View
can navigate the course, rounded to 3 decimal places.
Sample input: shubhamkr1 0.09 1.6M C View
1
shiwam23 0.09 1.6M C View
5 10
3 View
60 tushariitkgp 0.09 2.2M C
57
-2 -7
1 of 7
Sample output:
2.720
Explanation:
HELP
The image below shows the course corresponding to the sample input. The black circles represent the
boundaries of the racetrack, the small dots the cones, and the filled red circle the car. Also shown is one
possible path of the car through the course.
Author: pieguy
Tester: innocentboy
Editorial http://discuss.codechef.com/problems/COURSE
Date Added: 9-06-2010
Time Limit: 1 sec
Source 50000 Bytes
Limit:
converted by W eb2PDFConvert.com
Program should read from standard input and write to
ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 4.8.1, CPP11, standard output. After you submit a solution you can see
Languages: CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, your results by clicking on the [My Submissions] tab on
NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH
3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC the problem page. Below are the possible results:
thanks in advance.
can anyone explain what we are supposed to find?? i am not even able to get the question?? Thanks
in advance..
u need to find the diameter of the largest car that can pass through the area between the concentric
circles.
the point of the obstacles are given .so the diameter can vary from r circle boundary to point (on line
x=y) or from point to R circle boundary ..
converted by W eb2PDFConvert.com
can anyone please explain me the application of prim's algorithm in solving this problem.
i know prim's algorithm but not getting its application in one of the solutions.
Can we modify the way input is taken? or is it have to be in the exact same way given above?
hello friends.... the algo which i am following seems right to me to solve this problem but i am getting
wrong answer on submission. for sample input my answer is correct.
hi @admin i do really think that there is an error with the test cases of this exercice,it sending me a
wrong answer(more than ones) despite a have make an input file of my own where i think i really
take the most extreme cases and it gives me correct answer can you guy actually verify the test
cases please!!
can anyone help me out.. i am new here.. I am getting correct answer for the sample input given
above on my PC ,but when i submit it ..it gives me a runtime error msg.. Is there some problem with
the program or what.. ? I have written this program in java..
the deed is done but what's up with the java I/O of these guys. it's not taking the input the way it
should.... bad management guys.. at least show us the WRONG output for debugging...
DISAPPOINTED
@admin plz tell us the test case so that we cn figure out the problem bcoz its not giving write answer
to most of us.
i am getng runtime error in it..plz can any1 explain y ?? #include #include int main() {float tem,d[4]=
{0},D[4]; int co[4][2],i,j,c,r,R,k ,t; scanf("%d",&t); while(t--) {scanf("%d%d%d",&R,&r,&c);for(i=0;i(d[k]-r))
{D[k]=(R-d[k]);} else{D[k]=(d[k]-r);}k++;} for(i=0;iD[j]){ tem=D[i]; D[i]=D[j]; D[j]=tem;}}}printf("%fn",D[c-
1]);}return 0;}
@author pieguy pls give me 1 or 2 test cases for which my code is wrong... id: 1657175
Hello All, this question has problem with inputs , it can be proved by Making two programs in java,
one taking input by Scanner other by BufferedReader. one with buffered reader will always give you
RUNTIME ERROR(non-zero exit code).
Hey All, I am getting "Wrong Answer" for my solution. Any pointers to what i am doing wrong will be
appreciated. My code is at here - http://www.codechef.com/viewsolution/1839873
this is my code and i m getting runtime error import java.util.*; public class obstrk{ public static
double sqr(int a){ return a*a; } public static double modulus(int a, int b){ return
Math.sqrt(sqr(a)+sqr(b)); } public static double max(double n1, double n2 ){ if (n1
@doggysaurabh : You need to name the file as Main.java and the class as Main in which the public
static void main(... method should reside . Otherwise codechef judge will throw , "No Main class
found" exception and hence a runtime error .
converted by W eb2PDFConvert.com
m 2 getting wrong answer for my solution though it matches with the one given except that my sol is
2.72 as i used setprecision upto 3 decimal places but in eg its given 2.720.
there are some cases like if there are two or more than two obstacles in the same line;........ also
there is possible test case of no obstacle ;,,,,,,,,, keep these two things in mind
I am getting "Runtime error NZEC".I am unable to find my mistake.Could anybody help me in figuring
out the mistake. Please find the source code at the link:
http://www.codechef.com/viewsolution/4756071
I am getting a wrong answer. My code is working fine and giving correct answer on my PC. Please
help me. My code is http://www.codechef.com/viewsolution/5022417
converted by W eb2PDFConvert.com