×

 0 why am i getting WA?? question-link text solution-link text asked 23 Jun '17, 08:51 1●1 accept rate: 0%

 1 mistake : 1) for(i=1;i<=n;++i) cin>>a[i]; sort(a,a+n); sort() sorts from a[0] to a[n-1] and your input is from a[1] to a[n] 2) long min=a[n]; // I changed the array to operate from a[0] to a[n-1] so min = a[n-1] answered 23 Jun '17, 09:42 893●2●11●35 accept rate: 10% thanks!!!! (23 Jun '17, 10:12)

https://www.codechef.com/viewsolution/14313839 question: life the universe the everthing

# include <stdio.h>

int main(void) { int i; while (1) { scanf("%d", &i); if (i == 42) break; printf("%d", i); } return 0; }

1
accept rate: 0%

1

You are not printing each number in new line. Add '\n' in printf statement.

(23 Jun '17, 12:25)

Thanks :-)

(24 Jun '17, 11:39)
 0 https://www.codechef.com/viewsolution/14319887 whats wrong with this code it says time limit exceeded answered 24 Jun '17, 12:17 1 accept rate: 0% First of all your array size if not according to constraint (24 Jun '17, 13:17) Also, your logic doesn't seem correct to me.Modify it. (24 Jun '17, 13:17)
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×3,820
×1,070
×801

question asked: 23 Jun '17, 08:51

question was seen: 260 times

last updated: 24 Jun '17, 13:17