You are not logged in. Please login at www.codechef.com to post your questions!

×

PT07Z wrong answer

This is the link to the question http://www.spoj.com/problems/PT07Z/ . And Link to my solution https://repl.it/@NikhilAgrawal/TanPlumGreatargus .

I am not getting for what case is my answer wrong?

asked 14 Dec '17, 23:36

kaneki13's gravatar image

4★kaneki13
645
accept rate: 16%


In line 51, it should be

$if\ (mx < dist[i])$

instead of

$if\ (mx > dist[i])$

Rest looks correct and should get an AC.

link

answered 19 Dec '17, 16:40

c_utkarsh's gravatar image

5★c_utkarsh
1.1k5
accept rate: 17%

1

Thanks! Silly mistake, It was!

(20 Dec '17, 00:10) kaneki134★

INPUT:

5
1 2
2 3
1 4
4 5

YOUR OUTPUT: 2

CORRECT OUTPUT: 4

link

answered 18 Dec '17, 17:10

vivek_1998299's gravatar image

6★vivek_1998299
1.6k29
accept rate: 23%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×18

question asked: 14 Dec '17, 23:36

question was seen: 173 times

last updated: 20 Dec '17, 00:10