Search found 5 matches

by Skt
Sun Oct 11, 2009 9:10 pm
Forum: Volume 100 (10000-10099)
Topic: 10000 - Longest Paths
Replies: 160
Views: 36308

Re: 10000 - Longest Path

#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; cin>>sou...
by Skt
Tue Sep 22, 2009 10:46 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 45808

Re: 673 - Parentheses Balance

i actually forgot to clear the stack
while(!s.empty()) s.pop();
this is it
by Skt
Tue Sep 22, 2009 10:27 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 45808

Re: 673 - Parentheses Balance

removed after AC
by Skt
Tue Sep 22, 2009 4:41 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 31394

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); if(mirror == ...
by Skt
Tue Sep 15, 2009 7:30 pm
Forum: Volume 106 (10600-10699)
Topic: 10684 - The jackpot
Replies: 34
Views: 18890

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) cin>>arr...

Go to advanced search