#include<iostream>
#include<queue>
using namespace std;
int dist[103],maxi;
bool G[103][103];
void bfs(int node);
int main()
{
bool one = 0;
int j,i,r,c,p,q,source,pos,ans,kase = 1;
while(cin>>maxi && maxi)
{
for(i=0;i<maxi;i++) for(j = 0;j<maxi;j++) G [j] = 0;
for(i=0;i<maxi;i++) dist = 0 ...
Search found 5 matches
- Sun Oct 11, 2009 9:10 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10000 - Longest Paths
- Replies: 160
- Views: 56559
- Tue Sep 22, 2009 10:46 pm
- Forum: Volume 6 (600-699)
- Topic: 673 - Parentheses Balance
- Replies: 243
- Views: 79383
Re: 673 - Parentheses Balance
i actually forgot to clear the stack
while(!s.empty()) s.pop();
this is it
while(!s.empty()) s.pop();
this is it
- Tue Sep 22, 2009 10:27 pm
- Forum: Volume 6 (600-699)
- Topic: 673 - Parentheses Balance
- Replies: 243
- Views: 79383
Re: 673 - Parentheses Balance
removed after AC
- Tue Sep 22, 2009 4:41 pm
- Forum: Volume 4 (400-499)
- Topic: 401 - Palindromes
- Replies: 196
- Views: 58039
Re: 401- Palindromes
PLZ HELP ME WID THIS AS FAR AS I THINK IM CORRECT
#include<iostream>
using namespace std;
bool ismirr(string);
int main()
{
string str,str1;
bool palin,mirror;
while(cin>>str)
{
str1 = str;
reverse(str.begin(),str.end());
if(str1 == str) palin = 1;
else palin = 0;
mirror = ismirr(str ...
#include<iostream>
using namespace std;
bool ismirr(string);
int main()
{
string str,str1;
bool palin,mirror;
while(cin>>str)
{
str1 = str;
reverse(str.begin(),str.end());
if(str1 == str) palin = 1;
else palin = 0;
mirror = ismirr(str ...
- Tue Sep 15, 2009 7:30 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10684 - The jackpot
- Replies: 34
- Views: 25209
Re: 10684 - The Jackpot
well this is how my code looks like if i have found it to be coorect its the maximum sum and used dp for it can any one plz tell my errors or provide me with test case which would help me realize my error
long long i,j,arr[1001];
while(cin>>n && n!=0)
{
long long s[1001] = {0};
FOR(i,1,n+1 ...
long long i,j,arr[1001];
while(cin>>n && n!=0)
{
long long s[1001] = {0};
FOR(i,1,n+1 ...