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

×

difference between code blocks and ideone.. PLEASE HELP

for the problem http://www.codechef.com/problems/LCH15JAB/ my solution is http://www.codechef.com/viewsolution/6558800

this is working fine in code blocks gcc compiler but giving WA here as well as ideone. what is the problem???

asked 21 Mar '15, 21:43

rishu97kr's gravatar image

2★rishu97kr
2527
accept rate: 0%


@rishu97kr
I am sorry I am not familiar with the concept of this fast input process,

    ios::sync_with_stdio(false);    
cin.tie(NULL);
But what i found was this is the sole reason of mismatched output.
You can see here i just removed those two lines from your code and added a getchar() after taking test cases so as to take '\n' and your code gave same output in codeblocks and ideone.

Here is the ideone Link:
https://ideone.com/JrLboJ

And Output of your code in codeblocks:

alt text


link

answered 22 Mar '15, 20:34

rishabhprsd7's gravatar image

2★rishabhprsd7
1.9k11141
accept rate: 14%

Ideone is an online compiler and codeblocks in offline compiler..
It may be working fine on codeblocks because you are not testing your program on corner or tricky test cases and thus your code is failing for that problem. Try to test tricky and corner cases..

link

answered 21 Mar '15, 21:48

rishabhprsd7's gravatar image

2★rishabhprsd7
1.9k11141
accept rate: 14%

but i am giving same input in my codeblocks compiler and at ideone, and it is showing different results...in codeblocks it is showing correct answer but not at ideone.(again for same input)

(21 Mar '15, 23:25) rishu97kr2★

can you send the ideone link here?

(21 Mar '15, 23:28) rishabhprsd72★

and the test case too.. also mail me the code you are running at codeblocks @rishabhprsd7@gmail.com

(21 Mar '15, 23:31) rishabhprsd72★

i have mailed you the details

(22 Mar '15, 14:24) rishu97kr2★
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:

×2,535
×2,190
×1,818
×1,441
×905
×607
×46
×6

question asked: 21 Mar '15, 21:43

question was seen: 4,423 times

last updated: 22 Mar '15, 20:34