# Why won't this simple bitmask dp solution work?

I recently learned dp bitmasking and tried my first problem: https://www.codechef.com/problems/TSHIRTS

I initially have mask of n bits of 1, each set bit representing that the elephant is not assigned a t-shirt yet.
Here is what I have done:

``````#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize "trapv"
#define ll long long

ll const mod = 1e9+7;
ll dp[100][1<<10];
unordered_set<int> adj[10]; //people: tshirt
int n;

ll solve(int i,int mask) {
return 1;
if (i>99)
return 0;
}
ll ans = 0;
for (int j=0;j<n;j++) {
ans= (ans+solve(i+1, mask & (~(1<<j))))%mod;
}
// also possible to not assign any person to this tshirt at all
ans= (ans+ solve(i+1, mask))%mod;
return ans;
}

int main() {
int t; cin>>t;
while (t--) {
cin>>n;
for (int i=0;i<100;i++) {
for (int j=0;j<(1<<n);j++)
dp[i][j]=-1;
}
for (int i=0;i<n;i++)
string line;
getline(cin, line);
for(int i = 0;i < n; i++) {
int x;
getline(cin, line);
stringstream s(line);
while(s >> x)