Please any one tell me that what will be the output when x==y
if x is a city and there is no willing route then d[x] should be -1 right??
and let ,
a b c thee cities and the willing routes are a->b and a->c
and only a has airport then
if the king wants setup a route from b to b then what will ...
Search found 9 matches
- Sat Apr 04, 2009 8:02 am
- Forum: Volume 113 (11300-11399)
- Topic: 11377 - Airport Setup
- Replies: 24
- Views: 15798
- Fri Apr 03, 2009 8:47 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11377 - Airport Setup
- Replies: 24
- Views: 15798
Re: 11377 - Airport Setup
Please give some input output
I cannot find my bug !!


I cannot find my bug !!





- Wed Apr 01, 2009 8:01 pm
- Forum: Volume 3 (300-399)
- Topic: 315 - Network
- Replies: 68
- Views: 33309
Re: 315 Network
I think the given graph can be disconnected !!
My code handled that and got AC.
try this case :

My code handled that and got AC.
try this case :
Code: Select all
input:
7
1 2 3
2 3
5 6
6 7
0
0
output :
2
- Tue Mar 31, 2009 12:46 pm
- Forum: Volume 5 (500-599)
- Topic: 539 - The Settlers of Catan
- Replies: 22
- Views: 10695
Re: 539 why wa ..plz help
Hello rio??
there is no input like
2 2
0 1
1 0
there is no input like
2 2
0 1
1 0
- Tue Mar 24, 2009 9:03 pm
- Forum: Volume 5 (500-599)
- Topic: 558 - Wormholes
- Replies: 30
- Views: 20949
Re: 558 - Wormholes
Is everyone dead!!??!!
please help me!!......
i am filling very bad.........
Here is my code:
//Autor: Muhammad Rifayat Samee
// algorithm: 558(bellman-Ford)
#include<cstdio>
#include<cstring>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<stack>
#include<algorithm ...
please help me!!......
i am filling very bad.........
Here is my code:
//Autor: Muhammad Rifayat Samee
// algorithm: 558(bellman-Ford)
#include<cstdio>
#include<cstring>
#include<cctype>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<stack>
#include<algorithm ...
- Wed Mar 18, 2009 9:20 pm
- Forum: Volume 5 (500-599)
- Topic: 558 - Wormholes
- Replies: 30
- Views: 20949
Re: 558 - Wormholes
I have used bellman ford for this
I am getting WA .......
plz help me with some I/O.....
I am getting mad
I am getting WA .......
plz help me with some I/O.....
I am getting mad

- Sun Mar 15, 2009 10:30 am
- Forum: Volume 5 (500-599)
- Topic: 558 - Wormholes
- Replies: 30
- Views: 20949
PLZ Help Why run time error!!!
Why RTE!!??!!
int graph[10005][10005];
void warshall(int v)
{
int i,j,k;
for(k=0;k<v;k++)
{
for(i=0;i<v;i++)
{
for(j=0;j<v;j++)
{
if(graph[i][k] * graph[k][j]!=0)
{
if(graph[i][k]+graph[k][j]<graph[i][j]||graph[i][j] == 0)
{
graph[i][j] = graph[i][k] +graph[k][j ...
int graph[10005][10005];
void warshall(int v)
{
int i,j,k;
for(k=0;k<v;k++)
{
for(i=0;i<v;i++)
{
for(j=0;j<v;j++)
{
if(graph[i][k] * graph[k][j]!=0)
{
if(graph[i][k]+graph[k][j]<graph[i][j]||graph[i][j] == 0)
{
graph[i][j] = graph[i][k] +graph[k][j ...
- Sun Dec 30, 2007 5:31 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10190 - Divide, But Not Quite Conquer!
- Replies: 105
- Views: 38442
why WA??
Why WA???
please help me
#include<stdio.h>
#include<string.h>
#include<math.h>
#define eps 0.0000001
int main()
{
int n,m,r,k,k1;
double re;
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
while(scanf("%d %d",&n,&m)!=EOF)
{
if(n==1||m==1)printf("Boring!\n");
else if ...
please help me
#include<stdio.h>
#include<string.h>
#include<math.h>
#define eps 0.0000001
int main()
{
int n,m,r,k,k1;
double re;
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
while(scanf("%d %d",&n,&m)!=EOF)
{
if(n==1||m==1)printf("Boring!\n");
else if ...
- Wed Jan 10, 2007 7:41 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10070 - Leap Year or Not Leap Year and ...
- Replies: 233
- Views: 83831
10070 PE help
MY CODE:
#include <stdio.h>
#include <string.h>
void main(void)
{ char year[1000000];
int i,leap,ord;
while (scanf("%s",&year)!=EOF)
{
int mod4,mod100,mod400,mod15,mod55;
mod4=mod100=mod400=mod15=mod55=0;
ord=1;leap=0;
printf("\n");
for (i=0;i<strlen(year);i++)
{
mod4=(mod4*10+year -'0')%4 ...
#include <stdio.h>
#include <string.h>
void main(void)
{ char year[1000000];
int i,leap,ord;
while (scanf("%s",&year)!=EOF)
{
int mod4,mod100,mod400,mod15,mod55;
mod4=mod100=mod400=mod15=mod55=0;
ord=1;leap=0;
printf("\n");
for (i=0;i<strlen(year);i++)
{
mod4=(mod4*10+year -'0')%4 ...