## Search found 72 matches

Tue Oct 21, 2008 8:41 pm
Forum: Volume 115 (11500-11599)
Topic: 11536 - Smallest Sub-Array
Replies: 9
Views: 1996

### Re: 11536 - Smallest Sub-Array

Try these Input:

Code: Select all

``````
2
20 12 2
20 1 2
``````
output:

Code: Select all

``````Case 1: 2
Case 2: 2
``````
Hope you find mistake.
Tue Oct 14, 2008 1:42 pm
Forum: Volume 5 (500-599)
Topic: 507 - Jill Rides Again
Replies: 92
Views: 30045

### Re: 507 - Jill rides again

Try this case also:
Input:::

Code: Select all

``````
1
5
3
-3
4
1``````
output:::

Code: Select all

``The nicest part of route 1 is between stops 1 and 5``
Sun Sep 14, 2008 7:33 pm
Forum: Volume 4 (400-499)
Topic: 459 - Graph Connectivity
Replies: 132
Views: 24940

### Re: 459 - Graph Connectivity

To jainal, compare your code with below code segment See the change to take input of gets()// gets is very dangerous so I prefer scanf() char str[10000],max,*p,tmp[10]; scanf("%d",&test); gets(str); gets(str); for(int i = 0; i < test; i++){ if(i ) printf("\n"); scanf("%s",&tmp); max=tmp[0]; nV = max...
Sat Aug 30, 2008 1:03 pm
Forum: Volume 112 (11200-11299)
Topic: 11280 - Flying to Fredericton
Replies: 43
Views: 16594

### Re: 11280 - Flying to Fredericton

I solve it using BFS....
keeping how many node are traveled and their minimum cost.
So which algorithm you are using are not matter.
Fri Aug 22, 2008 9:07 pm
Forum: Volume 111 (11100-11199)
Topic: 11100 - The Trip, 2007
Replies: 18
Views: 13875

### Re: 11100 - The Trip, 2007

Dear Ankit,
Output an empty line between cases
Sat Jun 28, 2008 4:37 pm
Forum: Volume 104 (10400-10499)
Topic: 10446 - The Marriage Interview :-)
Replies: 17
Views: 9618

### Re: 10446 - The Marriage Interview ;-)

I am little bit confused about description and sample input. The input file contains several lines of input. Each line contains two integers n(n<=61) and back(back<=60). But sample input Sample Input 3 3 4 4 5 5 6 6 7 7 8 8 9 9 61 61 ----- back is greater than 60 The output for 60 60 is: 17293822569...
Tue Apr 22, 2008 8:58 pm
Forum: Volume 5 (500-599)
Topic: 587 - There's treasure everywhere!
Replies: 37
Views: 2643

### Re: 587 There's treasure everywhere! WA

if(casno > 1)
puts("");

Problem Statement say:
Print a blank line after each test case
Not between two test case.
Tue Mar 20, 2007 7:10 pm
Forum: Volume 3 (300-399)
Topic: 392 - Polynomial Showdown
Replies: 93
Views: 18092

### last space

your code is- #include<stdio.h> #include<string.h> #include<stdlib.h> long int index,i,a,num,x,sum,res[10000]={0},dum,tot,flag; char ish[10000],temp[10000]; void main() { // freopen("h:\\392.txt","r",stdin); // freopen("h:\\out.txt","w",stdout); while(gets(ish)) { x=strlen(ish); i=-1;index=-1;dum=0;...
Tue Sep 05, 2006 4:00 pm
Forum: Volume 102 (10200-10299)
Topic: 10235 - Simply Emirp
Replies: 150
Views: 31386

### 10235

please use long int .
Thu Aug 24, 2006 5:48 pm
Forum: Volume 7 (700-799)
Topic: 713 - Adding Reversed Numbers
Replies: 142
Views: 40481

### very easy

it is not so difficult;
adding reverse but no need to reverse;
add two string from left side to right side normal
print then canceling first 0 digit
input:-

101
99
out put -
2
[/code][/b][/list][/list]
Fri Jun 09, 2006 6:46 pm
Forum: Volume 100 (10000-10099)
Topic: 10062 - Tell me the frequencies!
Replies: 235
Views: 36714

### 10062 why WA

this is my code pls find worng answer #include<stdio.h> void main() { out: int a,x,p,i=0,j,tm1,tm2,y=0,k[128]={0},l[128]={0}; char m; while((char)(m=getchar())!=EOF) { if(m=='\n'||m=='\r') goto end; a=(int)m; if(a<32||a>=128) goto out; for(j=0;j<=i;j++) if(a==k[j]) { l[j]++; y--; break; } else if(j=...
Tue Jun 06, 2006 4:05 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 20533

### 107

why time limit exceed?