My code:
#include<cstdio>
#include<cstring>
#include<cstdlib>
char s[220][15];bool sd[220][220];int dis[220];
inline void init_d(int n){for(int i=0;i<n;i++)dis[i]=24748364;}
void bfs(int i,int j,int n)
{
for(;j<n;j++)
{
if(sd[i][j]==1&&dis[j]>dis[i]+1)
{
dis[j]=dis[i]+1;
bfs(i,j+1,n);
bfs ...
Search found 6 matches
- Thu Oct 13, 2011 11:32 am
- Forum: Volume 4 (400-499)
- Topic: 429 - Word Transformation
- Replies: 82
- Views: 31973
- Wed Jul 27, 2011 9:37 am
- Forum: Volume 7 (700-799)
- Topic: 776 - Monkeys in a Regular Forest
- Replies: 51
- Views: 24817
Re: 776 - Monkeys in a Regular Forest
It seems to me that I didn't get the problem. Output file has to show lines of integers separated by as many blank spaces as required to align columns to the right. What does this line mean?
However, how come this input outputs that??
a b c d e f g h
h g f e d c a b
a b c d e f g h
h g f e d c a b ...
However, how come this input outputs that??
a b c d e f g h
h g f e d c a b
a b c d e f g h
h g f e d c a b ...
- Mon Jul 11, 2011 7:34 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11827 - Maximum GCD
- Replies: 22
- Views: 8524
Re: 11827 - Maximum GCD (Why RE??)
Sorry, I'd got AC before I saw your post but I forgot to remove the post.
plamplam, I think my problem was getting the numbers from the input string.
plamplam, I think my problem was getting the numbers from the input string.
- Thu Jun 30, 2011 6:08 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11827 - Maximum GCD
- Replies: 22
- Views: 8524
Re: 11827 - Maximum GCD (Why RE??)
Someone please reply......
- Sun Jun 26, 2011 10:58 am
- Forum: Volume 118 (11800-11899)
- Topic: 11827 - Maximum GCD
- Replies: 22
- Views: 8524
- Sat Jun 25, 2011 3:37 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11827 - Maximum GCD
- Replies: 22
- Views: 8524