Search found 30 matches
- Fri Aug 24, 2007 2:56 pm
- Forum: Volume 5 (500-599)
- Topic: 548 - Tree
- Replies: 23
- Views: 11641
#include<iostream> #include<sstream> #include<vector> using namespace std; #define vi vector<int> #define sz size() #define pb push_back #define imax 100000001; struct node{ int data; struct node* left; struct node* right; }; struct node* rec(vi in,vi p) { if (in.sz==0) return NULL; int t; bool fla...
- Mon Apr 02, 2007 1:52 pm
- Forum: Volume 7 (700-799)
- Topic: 732 - Anagrams by Stack
- Replies: 17
- Views: 12717
//nth combination of 0 and 1's #include<iostream> #include<string> #include<vector> using namespace std; string s1,s2; vector<char> v; void backtrack(int n,int i) { if(i==2*n) { vector<char> vi,vi1; int j=0; for (int k=0;k<v.size();k++) { // cout<<v[k]; if (v[k]=='i') { vi.push_back(s1[j]); j++; } ...
- Thu Jan 18, 2007 9:50 pm
- Forum: Volume 3 (300-399)
- Topic: 336 - A Node Too Far
- Replies: 121
- Views: 44181
- Sat Sep 09, 2006 10:28 am
- Forum: Volume 4 (400-499)
- Topic: 496 - Simply Subsets
- Replies: 48
- Views: 10456
- Fri Sep 08, 2006 8:00 am
- Forum: Volume 103 (10300-10399)
- Topic: 10394 - Twin Primes
- Replies: 101
- Views: 35275
#include<iostream> #include<cmath> using namespace std; int main() { int l=1,u=20000000,d,j; d=u-l+1; bool *flag=new bool[d]; for (int i=0;i<d;i++) flag[i]=true; for (int i=(l%2!=0);i<d;i+=2) flag[i]=false; for (int i=3;i<=sqrt(u);i+=2) { j=l; while (j%i!=0) j++; for (j=j+i;j<u;j+=i) flag[j-l]=fals...
- Thu Aug 24, 2006 2:13 pm
- Forum: Volume 4 (400-499)
- Topic: 496 - Simply Subsets
- Replies: 48
- Views: 10456
Code: Select all
for input
-9 -9
9 -9
your output is...
A and B are disjoint
this should be
A is a proper subset of B
- Thu Aug 24, 2006 10:12 am
- Forum: Volume 108 (10800-10899)
- Topic: 10878 - Decode the tape
- Replies: 23
- Views: 16731
- Thu Aug 24, 2006 12:12 am
- Forum: Volume 108 (10800-10899)
- Topic: 10878 - Decode the tape
- Replies: 23
- Views: 16731
- Thu Aug 24, 2006 12:09 am
- Forum: Volume 108 (10800-10899)
- Topic: 10878 - Decode the tape
- Replies: 23
- Views: 16731
- Wed Aug 23, 2006 11:26 pm
- Forum: Volume 108 (10800-10899)
- Topic: 10878 - Decode the tape
- Replies: 23
- Views: 16731
Code: Select all
code removed after AC
plz help me out...[/b]
- Mon Aug 21, 2006 9:29 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10450 - World Cup Noise
- Replies: 42
- Views: 21099
- Mon Aug 21, 2006 10:08 am
- Forum: Volume 104 (10400-10499)
- Topic: 10450 - World Cup Noise
- Replies: 42
- Views: 21099
- Thu Aug 10, 2006 10:05 pm
- Forum: Volume 104 (10400-10499)
- Topic: 10487 - Closest Sums
- Replies: 89
- Views: 32298
- Wed Aug 09, 2006 7:44 pm
- Forum: Volume 5 (500-599)
- Topic: 507 - Jill Rides Again
- Replies: 92
- Views: 32569
i am getting correct answers for all available test cases still i am getting WA plz help... #include<iostream> #include<string> #include<vector> using namespace std; int main() { int n; cin>>n; for (int i=0;i<n;i++) { int q; cin>>q; int a[q-1]; int b[q-1]; for (int j=0;j<q-1;j++) cin>>a[j]; int sum...
- Mon Aug 07, 2006 6:17 pm
- Forum: Volume 4 (400-499)
- Topic: 444 - Encoder and Decoder
- Replies: 155
- Views: 25964