Search found 20 matches
- Wed Mar 11, 2009 10:02 pm
- Forum: Volume 3 (300-399)
- Topic: 371 - Ackermann Functions
- Replies: 196
- Views: 28545
Re: 371 - Ackermann Functions #TLE. Please Help!
Even then i am getting TLE.. :( i have commented at proper places.. pls check #include<iostream> #include<map> #include<cmath> using namespace std; int main() { long long m,n; map<long long,long long> mp; long long c; long long max1,max2; mp[1]=3; while(1) { scanf("%lld %lld",&m,&n); if(m==0 && n==0...
- Wed Mar 11, 2009 8:27 pm
- Forum: Volume 3 (300-399)
- Topic: 371 - Ackermann Functions
- Replies: 196
- Views: 28545
Re: 371 - Ackermann Functions #TLE. Please Help!
Even after using memoization I am getting TLE... :( Please help.. #include<iostream> #include<map> #include<cmath> using namespace std; int main() { long long m,n; map<long long,long long> mp; long long c; long long max1,max2; mp[1]=3; while(1) { scanf("%lld %lld",&m,&n); if(m==0 && n==0) break; max...
- Sun Feb 22, 2009 12:57 am
- Forum: Volume 2 (200-299)
- Topic: 280 - Vertex
- Replies: 95
- Views: 22046
Re: 280 why TLE?
I am getting TLE for following code :( Please help #include<iostream> #include<vector> #include<stack> using namespace std; int main() { int n,t,k,x,y; vector< vector<int> > mat; // adjacency matrix vector<bool> vis; // visited nodes cin>>n; while(n!=0) { vis.resize(n,0); scanf("%d",&t); mat.resize(...
- Fri Feb 06, 2009 7:58 pm
- Forum: Volume 1 (100-199)
- Topic: 147 - Dollars
- Replies: 233
- Views: 21163
Re: why wa 147
Why WA :( #include<iostream> using namespace std; int coins[]={5,10,20,50,100,200,500,1000,2000,5000,10000}; long long nw[30001]; int main() { nw[0]=1; for(int i=0;i<11;i++) { int c=coins[i]; for(int j=c;j<=30000;j++) nw[j]=nw[j]+nw[j-c]; } float n; while(1) { cin>>n; if(n==0.00) break; int m=n*100;...
- Wed Feb 04, 2009 10:49 pm
- Forum: Volume 1 (100-199)
- Topic: 111 - History Grading
- Replies: 135
- Views: 22120
Re: 111 Why WA??
Thanks newkid..
I got AC
I got AC

- Wed Feb 04, 2009 9:18 pm
- Forum: Volume 1 (100-199)
- Topic: 111 - History Grading
- Replies: 135
- Views: 22120
Re: 111 Why WA??
I am getting WA for the following code.. Please help..
Code: Select all
deleted after AC..
- Sun Jan 18, 2009 9:27 pm
- Forum: Volume 4 (400-499)
- Topic: 492 - Pig-Latin
- Replies: 213
- Views: 25594
Re: 492 WA: tell me why ........................
I am getting WA for the following code.. Pease help.. :( #include<iostream> #include<string> using namespace std; int main() { string s,str; long long c,t,i; while(getline(cin,s)) { c=0; while(c<s.length()) { if(c==0) t=s.find(" ",c); else t=s.find(" ",c+1); //cout<<c<<" "<<t<<endl; str=s.substr(c,t...
- Tue Jan 13, 2009 5:15 pm
- Forum: Volume 5 (500-599)
- Topic: 572 - Oil Deposits
- Replies: 39
- Views: 16168
Re: 572 WA :-(
WA for the following code.. Please help.. #include<iostream> #include<string> #include<vector> #include<utility> #include<stack> using namespace std; int main() { int m,n,c=0,x,y; vector< vector<bool> > vb; vector<string> v; string st; pair<int,int> pii,tmp1,tmp2; stack< pair<int,int> > s; cin>>m; w...
- Mon Jan 12, 2009 12:26 am
- Forum: Volume 5 (500-599)
- Topic: 572 - Oil Deposits
- Replies: 39
- Views: 16168
Re: 572 WA :-(
I am getting WA for the following code.. Please help.. !!! #include<iostream> #include<string> #include<vector> #include<utility> #include<stack> using namespace std; int main() { int m,n,c=0,x,y; vector< vector<bool> > vb; vector<string> v; string st; pair<int,int> pii,tmp1,tmp2; stack< pair<int,in...
- Sun Jan 11, 2009 2:16 pm
- Forum: Volume 5 (500-599)
- Topic: 567 - Risk
- Replies: 46
- Views: 16701
Re: 567 (Risk) - Wrong Answer
Please help.. I am getting WA :( #include<iostream> #include<cmath> #include<iomanip> using namespace std; int main() { int g[25][25][25]; int t,m,c=0,x,y,n; while(1) { c++; for(int i=0;i<20;i++) for(int j=0;j<20;j++) { if(i!=j) g[0][i][j]=1000; else g[0][i][j]=0; } for(int i=0;i<19;i++) { if(cin>>t...
- Mon Jan 05, 2009 10:04 pm
- Forum: Volume 4 (400-499)
- Topic: 406 - Prime Cuts
- Replies: 187
- Views: 22470
Re: 406 - Prime Cuts
please help.. i am getting WA :( #include<iostream> #include<vector> #include<cmath> using namespace std; int main() { int m,n,sz; int p; vector<bool> v; vector<int> vi; while(cin>>m>>n) { vi.clear(); v.resize(m+1,0); p=sqrt(m); v[0]=0; v[1]=0; for(int i=2;i<=p;i++) if(!v[i]) for(int j=i*i;j<=m;j+=i...
- Mon Aug 04, 2008 11:26 pm
- Forum: Volume 4 (400-499)
- Topic: 424 - Integer Inquiry
- Replies: 96
- Views: 20011
What's wrong in the code..?? :(
#include<iostream> #include<string> #include<vector> #include<cmath> using namespace std; int main() { string str,ts; vector<string> s; int size; cin>>str; while(str!="0") { s.push_back(str); cin>>str; } size=s[0].size(); for(int i=1;i<s.size();i++) { size=max(size,int(s[i].size())); } for(int i=0;...
- Tue Jul 29, 2008 3:54 pm
- Forum: Volume 1 (100-199)
- Topic: 160 - Factors and Factorials
- Replies: 205
- Views: 24629
WA please help
please suggest a test case for which this code gives WA or please tell any other mistake.. :( #include<iostream> #include<iomanip> using namespace std; int main() { int n; int pr[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97}; int f[25],j,k; cin>>n; while(n!=0) { if(n==1)...
- Fri Jul 18, 2008 5:18 pm
- Forum: Volume 6 (600-699)
- Topic: 673 - Parentheses Balance
- Replies: 243
- Views: 45800
pls help WA :(
#include<iostream> #include<stack> #include<string> using namespace std; int main() { int n; stack<char> s; string str; cin>>n; for(int i=0;i<n;i++) { getline(cin,str); if(str.length()==0) goto end; s.push(str[0]); for(int j=1;j<str.length();j++) { if(s.empty()) s.push(str[j]); else { if((s.top()==...
- Thu Jul 17, 2008 12:17 am
- Forum: Volume 103 (10300-10399)
- Topic: 10340 - All in All
- Replies: 129
- Views: 31834
WA pls help
I am getting WA for this code -- pls help :( #include<iostream> #include<string> using namespace std; int main() { string s,t; long i,j; while(cin>>s>>t) { i=0; j=0; while(1) { if(s[i]==t[j]) { if(s[i-1]==t[j-1] || i==0 || j==0) {i++; j++;} else j++; } else j++; //cout<<s[i]<<" "<<t[j]<<endl; if(i==...